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
7f9ff0ba
Commit
7f9ff0ba
authored
Dec 19, 2012
by
fat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add js support for carousel indicators
parent
e9eff0cb
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
73 additions
and
25 deletions
+73
-25
docs/assets/js/bootstrap-carousel.js
docs/assets/js/bootstrap-carousel.js
+20
-6
docs/assets/js/bootstrap-modal.js
docs/assets/js/bootstrap-modal.js
+1
-2
docs/assets/js/bootstrap.js
docs/assets/js/bootstrap.js
+21
-8
docs/assets/js/bootstrap.min.js
docs/assets/js/bootstrap.min.js
+1
-1
docs/javascript.html
docs/javascript.html
+5
-0
docs/templates/pages/javascript.mustache
docs/templates/pages/javascript.mustache
+5
-0
js/bootstrap-carousel.js
js/bootstrap-carousel.js
+19
-6
js/bootstrap-modal.js
js/bootstrap-modal.js
+1
-2
No files found.
docs/assets/js/bootstrap-carousel.js
View file @
7f9ff0ba
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
var
Carousel
=
function
(
element
,
options
)
{
var
Carousel
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
)
this
.
$element
=
$
(
element
)
this
.
$indicators
=
this
.
$element
.
find
(
'
.carousel-indicators
'
)
this
.
options
=
options
this
.
options
=
options
this
.
options
.
pause
==
'
hover
'
&&
this
.
$element
this
.
options
.
pause
==
'
hover
'
&&
this
.
$element
.
on
(
'
mouseenter
'
,
$
.
proxy
(
this
.
pause
,
this
))
.
on
(
'
mouseenter
'
,
$
.
proxy
(
this
.
pause
,
this
))
...
@@ -44,13 +45,17 @@
...
@@ -44,13 +45,17 @@
return
this
return
this
}
}
,
getActiveIndex
:
function
()
{
this
.
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
this
.
$items
=
this
.
$active
.
parent
().
children
()
return
this
.
$items
.
index
(
this
.
$active
)
}
,
to
:
function
(
pos
)
{
,
to
:
function
(
pos
)
{
var
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
var
activeIndex
=
this
.
getActiveIndex
()
,
children
=
$active
.
parent
().
children
()
,
activePos
=
children
.
index
(
$active
)
,
that
=
this
,
that
=
this
if
(
pos
>
(
children
.
length
-
1
)
||
pos
<
0
)
return
if
(
pos
>
(
this
.
$items
.
length
-
1
)
||
pos
<
0
)
return
if
(
this
.
sliding
)
{
if
(
this
.
sliding
)
{
return
this
.
$element
.
one
(
'
slid
'
,
function
()
{
return
this
.
$element
.
one
(
'
slid
'
,
function
()
{
...
@@ -58,11 +63,11 @@
...
@@ -58,11 +63,11 @@
})
})
}
}
if
(
active
Pos
==
pos
)
{
if
(
active
Index
==
pos
)
{
return
this
.
pause
().
cycle
()
return
this
.
pause
().
cycle
()
}
}
return
this
.
slide
(
pos
>
active
Pos
?
'
next
'
:
'
prev
'
,
$
(
children
[
pos
]))
return
this
.
slide
(
pos
>
active
Index
?
'
next
'
:
'
prev
'
,
$
(
this
.
$items
[
pos
]))
}
}
,
pause
:
function
(
e
)
{
,
pause
:
function
(
e
)
{
...
@@ -92,6 +97,7 @@
...
@@ -92,6 +97,7 @@
,
isCycling
=
this
.
interval
,
isCycling
=
this
.
interval
,
direction
=
type
==
'
next
'
?
'
left
'
:
'
right
'
,
direction
=
type
==
'
next
'
?
'
left
'
:
'
right
'
,
fallback
=
type
==
'
next
'
?
'
first
'
:
'
last
'
,
fallback
=
type
==
'
next
'
?
'
first
'
:
'
last
'
,
$nextIndicator
,
that
=
this
,
that
=
this
,
e
,
e
...
@@ -107,6 +113,14 @@
...
@@ -107,6 +113,14 @@
if
(
$next
.
hasClass
(
'
active
'
))
return
if
(
$next
.
hasClass
(
'
active
'
))
return
if
(
this
.
$indicators
.
length
)
{
this
.
$indicators
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
this
.
$element
.
one
(
'
slid
'
,
function
()
{
$nextIndicator
=
$
(
that
.
$indicators
.
children
()[
that
.
getActiveIndex
()])
$nextIndicator
&&
$nextIndicator
.
addClass
(
'
active
'
)
})
}
if
(
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
if
(
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
this
.
$element
.
trigger
(
e
)
this
.
$element
.
trigger
(
e
)
if
(
e
.
isDefaultPrevented
())
return
if
(
e
.
isDefaultPrevented
())
return
...
...
docs/assets/js/bootstrap-modal.js
View file @
7f9ff0ba
...
@@ -60,8 +60,7 @@
...
@@ -60,8 +60,7 @@
that
.
$element
.
appendTo
(
document
.
body
)
//don't move modals dom position
that
.
$element
.
appendTo
(
document
.
body
)
//don't move modals dom position
}
}
that
.
$element
that
.
$element
.
show
()
.
show
()
if
(
transition
)
{
if
(
transition
)
{
that
.
$element
[
0
].
offsetWidth
// force reflow
that
.
$element
[
0
].
offsetWidth
// force reflow
...
...
docs/assets/js/bootstrap.js
View file @
7f9ff0ba
...
@@ -289,6 +289,7 @@
...
@@ -289,6 +289,7 @@
var
Carousel
=
function
(
element
,
options
)
{
var
Carousel
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
)
this
.
$element
=
$
(
element
)
this
.
$indicators
=
this
.
$element
.
find
(
'
.carousel-indicators
'
)
this
.
options
=
options
this
.
options
=
options
this
.
options
.
pause
==
'
hover
'
&&
this
.
$element
this
.
options
.
pause
==
'
hover
'
&&
this
.
$element
.
on
(
'
mouseenter
'
,
$
.
proxy
(
this
.
pause
,
this
))
.
on
(
'
mouseenter
'
,
$
.
proxy
(
this
.
pause
,
this
))
...
@@ -305,13 +306,17 @@
...
@@ -305,13 +306,17 @@
return
this
return
this
}
}
,
getActiveIndex
:
function
()
{
this
.
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
this
.
$items
=
this
.
$active
.
parent
().
children
()
return
this
.
$items
.
index
(
this
.
$active
)
}
,
to
:
function
(
pos
)
{
,
to
:
function
(
pos
)
{
var
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
var
activeIndex
=
this
.
getActiveIndex
()
,
children
=
$active
.
parent
().
children
()
,
activePos
=
children
.
index
(
$active
)
,
that
=
this
,
that
=
this
if
(
pos
>
(
children
.
length
-
1
)
||
pos
<
0
)
return
if
(
pos
>
(
this
.
$items
.
length
-
1
)
||
pos
<
0
)
return
if
(
this
.
sliding
)
{
if
(
this
.
sliding
)
{
return
this
.
$element
.
one
(
'
slid
'
,
function
()
{
return
this
.
$element
.
one
(
'
slid
'
,
function
()
{
...
@@ -319,11 +324,11 @@
...
@@ -319,11 +324,11 @@
})
})
}
}
if
(
active
Pos
==
pos
)
{
if
(
active
Index
==
pos
)
{
return
this
.
pause
().
cycle
()
return
this
.
pause
().
cycle
()
}
}
return
this
.
slide
(
pos
>
active
Pos
?
'
next
'
:
'
prev
'
,
$
(
children
[
pos
]))
return
this
.
slide
(
pos
>
active
Index
?
'
next
'
:
'
prev
'
,
$
(
this
.
$items
[
pos
]))
}
}
,
pause
:
function
(
e
)
{
,
pause
:
function
(
e
)
{
...
@@ -353,6 +358,7 @@
...
@@ -353,6 +358,7 @@
,
isCycling
=
this
.
interval
,
isCycling
=
this
.
interval
,
direction
=
type
==
'
next
'
?
'
left
'
:
'
right
'
,
direction
=
type
==
'
next
'
?
'
left
'
:
'
right
'
,
fallback
=
type
==
'
next
'
?
'
first
'
:
'
last
'
,
fallback
=
type
==
'
next
'
?
'
first
'
:
'
last
'
,
$nextIndicator
,
that
=
this
,
that
=
this
,
e
,
e
...
@@ -368,6 +374,14 @@
...
@@ -368,6 +374,14 @@
if
(
$next
.
hasClass
(
'
active
'
))
return
if
(
$next
.
hasClass
(
'
active
'
))
return
if
(
this
.
$indicators
.
length
)
{
this
.
$indicators
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
this
.
$element
.
one
(
'
slid
'
,
function
()
{
$nextIndicator
=
$
(
that
.
$indicators
.
children
()[
that
.
getActiveIndex
()])
$nextIndicator
&&
$nextIndicator
.
addClass
(
'
active
'
)
})
}
if
(
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
if
(
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
this
.
$element
.
trigger
(
e
)
this
.
$element
.
trigger
(
e
)
if
(
e
.
isDefaultPrevented
())
return
if
(
e
.
isDefaultPrevented
())
return
...
@@ -832,8 +846,7 @@
...
@@ -832,8 +846,7 @@
that
.
$element
.
appendTo
(
document
.
body
)
//don't move modals dom position
that
.
$element
.
appendTo
(
document
.
body
)
//don't move modals dom position
}
}
that
.
$element
that
.
$element
.
show
()
.
show
()
if
(
transition
)
{
if
(
transition
)
{
that
.
$element
[
0
].
offsetWidth
// force reflow
that
.
$element
[
0
].
offsetWidth
// force reflow
...
...
docs/assets/js/bootstrap.min.js
View file @
7f9ff0ba
This diff is collapsed.
Click to expand it.
docs/javascript.html
View file @
7f9ff0ba
...
@@ -1422,6 +1422,11 @@ $('#myCollapsible').on('hidden', function () {
...
@@ -1422,6 +1422,11 @@ $('#myCollapsible').on('hidden', function () {
<p>
The slideshow below shows a generic plugin and component for cycling through elements like a carousel.
</p>
<p>
The slideshow below shows a generic plugin and component for cycling through elements like a carousel.
</p>
<div
class=
"bs-docs-example"
>
<div
class=
"bs-docs-example"
>
<div
id=
"myCarousel"
class=
"carousel slide"
>
<div
id=
"myCarousel"
class=
"carousel slide"
>
<ol
class=
"carousel-indicators"
>
<li
class=
"active"
></li>
<li></li>
<li></li>
</ol>
<div
class=
"carousel-inner"
>
<div
class=
"carousel-inner"
>
<div
class=
"item active"
>
<div
class=
"item active"
>
<img
src=
"assets/img/bootstrap-mdo-sfmoma-01.jpg"
alt=
""
>
<img
src=
"assets/img/bootstrap-mdo-sfmoma-01.jpg"
alt=
""
>
...
...
docs/templates/pages/javascript.mustache
View file @
7f9ff0ba
...
@@ -1352,6 +1352,11 @@ $('#myCollapsible').on('hidden', function () {
...
@@ -1352,6 +1352,11 @@ $('#myCollapsible').on('hidden', function () {
<p>
{{
_i
}}
The slideshow below shows a generic plugin and component for cycling through elements like a carousel.
{{/
i
}}
</p>
<p>
{{
_i
}}
The slideshow below shows a generic plugin and component for cycling through elements like a carousel.
{{/
i
}}
</p>
<div
class=
"bs-docs-example"
>
<div
class=
"bs-docs-example"
>
<div
id=
"myCarousel"
class=
"carousel slide"
>
<div
id=
"myCarousel"
class=
"carousel slide"
>
<ol
class=
"carousel-indicators"
>
<li
class=
"active"
></li>
<li></li>
<li></li>
</ol>
<div
class=
"carousel-inner"
>
<div
class=
"carousel-inner"
>
<div
class=
"item active"
>
<div
class=
"item active"
>
<img
src=
"assets/img/bootstrap-mdo-sfmoma-01.jpg"
alt=
""
>
<img
src=
"assets/img/bootstrap-mdo-sfmoma-01.jpg"
alt=
""
>
...
...
js/bootstrap-carousel.js
View file @
7f9ff0ba
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
var
Carousel
=
function
(
element
,
options
)
{
var
Carousel
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
)
this
.
$element
=
$
(
element
)
this
.
$indicators
=
this
.
$element
.
find
(
'
.carousel-indicators
'
)
this
.
options
=
options
this
.
options
=
options
this
.
options
.
pause
==
'
hover
'
&&
this
.
$element
this
.
options
.
pause
==
'
hover
'
&&
this
.
$element
.
on
(
'
mouseenter
'
,
$
.
proxy
(
this
.
pause
,
this
))
.
on
(
'
mouseenter
'
,
$
.
proxy
(
this
.
pause
,
this
))
...
@@ -44,13 +45,17 @@
...
@@ -44,13 +45,17 @@
return
this
return
this
}
}
,
getActiveIndex
:
function
()
{
this
.
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
this
.
$items
=
this
.
$active
.
parent
().
children
()
return
this
.
$items
.
index
(
this
.
$active
)
}
,
to
:
function
(
pos
)
{
,
to
:
function
(
pos
)
{
var
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
var
activeIndex
=
this
.
getActiveIndex
()
,
children
=
$active
.
parent
().
children
()
,
activePos
=
children
.
index
(
$active
)
,
that
=
this
,
that
=
this
if
(
pos
>
(
children
.
length
-
1
)
||
pos
<
0
)
return
if
(
pos
>
(
this
.
$items
.
length
-
1
)
||
pos
<
0
)
return
if
(
this
.
sliding
)
{
if
(
this
.
sliding
)
{
return
this
.
$element
.
one
(
'
slid
'
,
function
()
{
return
this
.
$element
.
one
(
'
slid
'
,
function
()
{
...
@@ -58,11 +63,11 @@
...
@@ -58,11 +63,11 @@
})
})
}
}
if
(
active
Pos
==
pos
)
{
if
(
active
Index
==
pos
)
{
return
this
.
pause
().
cycle
()
return
this
.
pause
().
cycle
()
}
}
return
this
.
slide
(
pos
>
active
Pos
?
'
next
'
:
'
prev
'
,
$
(
children
[
pos
]))
return
this
.
slide
(
pos
>
active
Index
?
'
next
'
:
'
prev
'
,
$
(
this
.
$items
[
pos
]))
}
}
,
pause
:
function
(
e
)
{
,
pause
:
function
(
e
)
{
...
@@ -107,6 +112,14 @@
...
@@ -107,6 +112,14 @@
if
(
$next
.
hasClass
(
'
active
'
))
return
if
(
$next
.
hasClass
(
'
active
'
))
return
if
(
this
.
$indicators
.
length
)
{
this
.
$indicators
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
this
.
$element
.
one
(
'
slid
'
,
function
()
{
var
$nextIndicator
=
$
(
that
.
$indicators
.
children
()[
that
.
getActiveIndex
()])
$nextIndicator
&&
$nextIndicator
.
addClass
(
'
active
'
)
})
}
if
(
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
if
(
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
this
.
$element
.
trigger
(
e
)
this
.
$element
.
trigger
(
e
)
if
(
e
.
isDefaultPrevented
())
return
if
(
e
.
isDefaultPrevented
())
return
...
...
js/bootstrap-modal.js
View file @
7f9ff0ba
...
@@ -60,8 +60,7 @@
...
@@ -60,8 +60,7 @@
that
.
$element
.
appendTo
(
document
.
body
)
//don't move modals dom position
that
.
$element
.
appendTo
(
document
.
body
)
//don't move modals dom position
}
}
that
.
$element
that
.
$element
.
show
()
.
show
()
if
(
transition
)
{
if
(
transition
)
{
that
.
$element
[
0
].
offsetWidth
// force reflow
that
.
$element
[
0
].
offsetWidth
// force reflow
...
...
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