Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
5eaedbe0
Commit
5eaedbe0
authored
Jun 09, 2014
by
Katie Zhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change how carousel indicators activate #12592
parent
2213a5b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
js/carousel.js
js/carousel.js
+6
-10
No files found.
js/carousel.js
View file @
5eaedbe0
...
...
@@ -48,16 +48,14 @@
return
this
}
Carousel
.
prototype
.
getActiveIndex
=
function
()
{
this
.
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
this
.
$items
=
this
.
$active
.
parent
().
children
(
'
.item
'
)
return
this
.
$items
.
index
(
this
.
$active
)
Carousel
.
prototype
.
getItemIndex
=
function
(
item
)
{
this
.
$items
=
item
.
parent
().
children
(
'
.item
'
)
return
this
.
$items
.
index
(
item
||
this
.
$active
)
}
Carousel
.
prototype
.
to
=
function
(
pos
)
{
var
that
=
this
var
activeIndex
=
this
.
get
ActiveIndex
(
)
var
activeIndex
=
this
.
get
ItemIndex
(
this
.
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
)
if
(
pos
>
(
this
.
$items
.
length
-
1
)
||
pos
<
0
)
return
...
...
@@ -119,10 +117,8 @@
if
(
this
.
$indicators
.
length
)
{
this
.
$indicators
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
this
.
$element
.
one
(
'
slid.bs.carousel
'
,
function
()
{
// yes, "slid"
var
$nextIndicator
=
$
(
that
.
$indicators
.
children
()[
that
.
getActiveIndex
()])
$nextIndicator
&&
$nextIndicator
.
addClass
(
'
active
'
)
})
var
$nextIndicator
=
$
(
this
.
$indicators
.
children
()[
this
.
getItemIndex
(
$next
)])
$nextIndicator
&&
$nextIndicator
.
addClass
(
'
active
'
)
}
var
slidEvent
=
$
.
Event
(
'
slid.bs.carousel
'
,
{
relatedTarget
:
relatedTarget
,
direction
:
direction
})
// yes, "slid"
...
...
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