Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
7628fc0e
Commit
7628fc0e
authored
Feb 04, 2017
by
杨奕
Committed by
baiyaaaaa
Feb 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Carousel: apply infinite sliding in non-card mode (#2622)
parent
58195fc6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
packages/carousel/src/item.vue
packages/carousel/src/item.vue
+3
-4
packages/theme-default/src/carousel-item.css
packages/theme-default/src/carousel-item.css
+4
-1
packages/theme-default/src/carousel.css
packages/theme-default/src/carousel.css
+1
-0
No files found.
packages/carousel/src/item.vue
View file @
7628fc0e
...
...
@@ -70,11 +70,10 @@
translateItem
(
index
,
activeIndex
)
{
const
parentWidth
=
this
.
$parent
.
$el
.
offsetWidth
;
const
length
=
this
.
$parent
.
items
.
length
;
if
(
index
!==
activeIndex
&&
length
>
2
)
{
index
=
this
.
processIndex
(
index
,
activeIndex
,
length
);
}
if
(
this
.
$parent
.
type
===
'
card
'
)
{
if
(
index
!==
activeIndex
&&
length
>
2
)
{
index
=
this
.
processIndex
(
index
,
activeIndex
,
length
);
}
this
.
inStage
=
Math
.
round
(
Math
.
abs
(
index
-
activeIndex
))
<=
1
;
this
.
active
=
index
===
activeIndex
;
this
.
translate
=
this
.
calculateTranslate
(
index
,
activeIndex
,
parentWidth
);
...
...
packages/theme-default/src/carousel-item.css
View file @
7628fc0e
...
...
@@ -13,10 +13,13 @@
display
:
inline-block
;
transition
:
.4s
ease-in-out
;
overflow
:
hidden
;
z-index
:
calc
(
var
(
--index-normal
)
-
1
);
@when
active
{
z-index
:
calc
(
var
(
--index-normal
)
+
1
);
}
@modifier
card
{
width
:
50%
;
z-index
:
calc
(
var
(
--index-normal
)
-
1
);
&.is-in-stage
{
cursor
:
pointer
;
z-index
:
var
(
--index-normal
);
...
...
packages/theme-default/src/carousel.css
View file @
7628fc0e
...
...
@@ -55,6 +55,7 @@
transform
:
translateX
(
-50%
);
margin
:
0
;
padding
:
0
;
z-index
:
calc
(
var
(
--index-normal
)
+
1
);
@modifier
outside
{
bottom
:
calc
(
var
(
--carousel-indicator-height
)
+
var
(
--carousel-indicator-padding-vertical
)
*
2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment