Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
f87e4c60
Commit
f87e4c60
authored
13 years ago
by
Mark Otto
Browse files
Options
Download
Plain Diff
Merge branch '2.1.0-wip' into 2.0.3-wip
Conflicts: docs/assets/bootstrap.zip
parents
a5755422
b3bf2236
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
docs/assets/bootstrap.zip
+0
-0
docs/assets/bootstrap.zip
docs/assets/js/bootstrap-carousel.js
+12
-11
docs/assets/js/bootstrap-carousel.js
docs/assets/js/bootstrap-collapse.js
+17
-6
docs/assets/js/bootstrap-collapse.js
docs/assets/js/bootstrap-dropdown.js
+3
-1
docs/assets/js/bootstrap-dropdown.js
docs/assets/js/bootstrap-popover.js
+2
-4
docs/assets/js/bootstrap-popover.js
docs/assets/js/bootstrap-scrollspy.js
+26
-7
docs/assets/js/bootstrap-scrollspy.js
docs/assets/js/bootstrap-tooltip.js
+4
-4
docs/assets/js/bootstrap-tooltip.js
docs/assets/js/bootstrap-typeahead.js
+5
-3
docs/assets/js/bootstrap-typeahead.js
docs/javascript.html
+16
-1
docs/javascript.html
docs/templates/pages/javascript.mustache
+16
-1
docs/templates/pages/javascript.mustache
js/bootstrap-carousel.js
+12
-11
js/bootstrap-carousel.js
js/bootstrap-collapse.js
+17
-6
js/bootstrap-collapse.js
js/bootstrap-dropdown.js
+3
-1
js/bootstrap-dropdown.js
js/bootstrap-popover.js
+2
-4
js/bootstrap-popover.js
js/bootstrap-scrollspy.js
+26
-7
js/bootstrap-scrollspy.js
js/bootstrap-tooltip.js
+4
-4
js/bootstrap-tooltip.js
js/bootstrap-typeahead.js
+5
-3
js/bootstrap-typeahead.js
js/tests/index.html
+1
-1
js/tests/index.html
js/tests/unit/bootstrap-typeahead.js
+16
-0
js/tests/unit/bootstrap-typeahead.js
with
187 additions
and
75 deletions
+187
-75
docs/assets/bootstrap.zip
+
0
-
0
View file @
f87e4c60
No preview for this file type
This diff is collapsed.
Click to expand it.
docs/assets/js/bootstrap-carousel.js
+
12
-
11
View file @
f87e4c60
...
...
@@ -27,7 +27,7 @@
var
Carousel
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
)
this
.
options
=
$
.
extend
({},
$
.
fn
.
carousel
.
defaults
,
options
)
this
.
options
=
options
this
.
options
.
slide
&&
this
.
slide
(
this
.
options
.
slide
)
this
.
options
.
pause
==
'
hover
'
&&
this
.
$element
.
on
(
'
mouseenter
'
,
$
.
proxy
(
this
.
pause
,
this
))
...
...
@@ -37,7 +37,8 @@
Carousel
.
prototype
=
{
cycle
:
function
()
{
this
.
interval
=
setInterval
(
$
.
proxy
(
this
.
next
,
this
),
this
.
options
.
interval
)
this
.
options
.
interval
&&
(
this
.
interval
=
setInterval
(
$
.
proxy
(
this
.
next
,
this
),
this
.
options
.
interval
))
return
this
}
...
...
@@ -94,13 +95,7 @@
if
(
$next
.
hasClass
(
'
active
'
))
return
if
(
!
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
this
.
$element
.
trigger
(
'
slide
'
)
$active
.
removeClass
(
'
active
'
)
$next
.
addClass
(
'
active
'
)
this
.
sliding
=
false
this
.
$element
.
trigger
(
'
slid
'
)
}
else
{
if
(
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
$next
.
addClass
(
type
)
$next
[
0
].
offsetWidth
// force reflow
$active
.
addClass
(
direction
)
...
...
@@ -112,6 +107,12 @@
that
.
sliding
=
false
setTimeout
(
function
()
{
that
.
$element
.
trigger
(
'
slid
'
)
},
0
)
})
}
else
{
this
.
$element
.
trigger
(
'
slide
'
)
$active
.
removeClass
(
'
active
'
)
$next
.
addClass
(
'
active
'
)
this
.
sliding
=
false
this
.
$element
.
trigger
(
'
slid
'
)
}
isCycling
&&
this
.
cycle
()
...
...
@@ -129,11 +130,11 @@
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
carousel
'
)
,
options
=
typeof
option
==
'
object
'
&&
option
,
options
=
$
.
extend
({},
$
.
fn
.
carousel
.
defaults
,
typeof
option
==
'
object
'
&&
option
)
if
(
!
data
)
$this
.
data
(
'
carousel
'
,
(
data
=
new
Carousel
(
this
,
options
)))
if
(
typeof
option
==
'
number
'
)
data
.
to
(
option
)
else
if
(
typeof
option
==
'
string
'
||
(
option
=
options
.
slide
))
data
[
option
]()
else
data
.
cycle
()
else
if
(
options
.
interval
)
data
.
cycle
()
})
}
...
...
This diff is collapsed.
Click to expand it.
docs/assets/js/bootstrap-collapse.js
+
17
-
6
View file @
f87e4c60
...
...
@@ -42,11 +42,18 @@
}
,
show
:
function
()
{
var
dimension
=
this
.
dimension
()
,
scroll
=
$
.
camelCase
([
'
scroll
'
,
dimension
].
join
(
'
-
'
))
,
actives
=
this
.
$parent
&&
this
.
$parent
.
find
(
'
.in
'
)
var
dimension
,
scroll
,
actives
,
hasData
if
(
this
.
transitioning
)
return
dimension
=
this
.
dimension
()
scroll
=
$
.
camelCase
([
'
scroll
'
,
dimension
].
join
(
'
-
'
))
actives
=
this
.
$parent
&&
this
.
$parent
.
find
(
'
> .accordion-group > .in
'
)
hasData
if
(
actives
&&
actives
.
length
)
{
hasData
=
actives
.
data
(
'
collapse
'
)
actives
.
collapse
(
'
hide
'
)
...
...
@@ -56,11 +63,12 @@
this
.
$element
[
dimension
](
0
)
this
.
transition
(
'
addClass
'
,
'
show
'
,
'
shown
'
)
this
.
$element
[
dimension
](
this
.
$element
[
0
][
scroll
])
}
,
hide
:
function
()
{
var
dimension
=
this
.
dimension
()
var
dimension
if
(
this
.
transitioning
)
return
dimension
=
this
.
dimension
()
this
.
reset
(
this
.
$element
[
dimension
]())
this
.
transition
(
'
removeClass
'
,
'
hide
'
,
'
hidden
'
)
this
.
$element
[
dimension
](
0
)
...
...
@@ -74,7 +82,7 @@
[
dimension
](
size
||
'
auto
'
)
[
0
].
offsetWidth
this
.
$element
[
size
?
'
addClass
'
:
'
removeClass
'
](
'
collapse
'
)
this
.
$element
[
size
!=
null
?
'
addClass
'
:
'
removeClass
'
](
'
collapse
'
)
return
this
}
...
...
@@ -83,9 +91,12 @@
var
that
=
this
,
complete
=
function
()
{
if
(
startEvent
==
'
show
'
)
that
.
reset
()
that
.
transitioning
=
0
that
.
$element
.
trigger
(
completeEvent
)
}
this
.
transitioning
=
1
this
.
$element
.
trigger
(
startEvent
)
[
method
](
'
in
'
)
...
...
This diff is collapsed.
Click to expand it.
docs/assets/js/bootstrap-dropdown.js
+
3
-
1
View file @
f87e4c60
...
...
@@ -86,7 +86,9 @@
$
(
function
()
{
$
(
'
html
'
).
on
(
'
click.dropdown.data-api
'
,
clearMenus
)
$
(
'
body
'
).
on
(
'
click.dropdown.data-api
'
,
toggle
,
Dropdown
.
prototype
.
toggle
)
$
(
'
body
'
)
.
on
(
'
click.dropdown
'
,
'
.dropdown form
'
,
function
(
e
)
{
e
.
stopPropagation
()
})
.
on
(
'
click.dropdown.data-api
'
,
toggle
,
Dropdown
.
prototype
.
toggle
)
})
}(
window
.
jQuery
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docs/assets/js/bootstrap-popover.js
+
2
-
4
View file @
f87e4c60
...
...
@@ -38,8 +38,8 @@
,
title
=
this
.
getTitle
()
,
content
=
this
.
getContent
()
$tip
.
find
(
'
.popover-title
'
)
[
$
.
type
(
title
)
==
'
object
'
?
'
append
'
:
'
html
'
]
(
title
)
$tip
.
find
(
'
.popover-content > *
'
)
[
$
.
type
(
content
)
==
'
object
'
?
'
append
'
:
'
html
'
]
(
content
)
$tip
.
find
(
'
.popover-title
'
)
.
html
(
title
)
$tip
.
find
(
'
.popover-content > *
'
)
.
html
(
content
)
$tip
.
removeClass
(
'
fade top bottom left right in
'
)
}
...
...
@@ -56,8 +56,6 @@
content
=
$e
.
attr
(
'
data-content
'
)
||
(
typeof
o
.
content
==
'
function
'
?
o
.
content
.
call
(
$e
[
0
])
:
o
.
content
)
content
=
content
.
toString
().
replace
(
/
(
^
\s
*|
\s
*$
)
/
,
""
)
return
content
}
...
...
This diff is collapsed.
Click to expand it.
docs/assets/js/bootstrap-scrollspy.js
+
26
-
7
View file @
f87e4c60
...
...
@@ -43,25 +43,42 @@
constructor
:
ScrollSpy
,
refresh
:
function
()
{
this
.
targets
=
this
.
$body
var
self
=
this
,
$targets
this
.
offsets
=
[]
this
.
targets
=
[]
$targets
=
this
.
$body
.
find
(
this
.
selector
)
.
map
(
function
()
{
var
href
=
$
(
this
).
attr
(
'
href
'
)
return
/^#
\w
/
.
test
(
href
)
&&
$
(
href
).
length
?
href
:
null
,
$href
=
/^#
\w
/
.
test
(
href
)
&&
$
(
href
)
return
(
$href
&&
href
.
length
&&
[[
$href
.
position
().
top
,
href
]]
)
||
null
})
.
sort
(
function
(
a
,
b
)
{
return
a
[
0
]
-
b
[
0
]
})
.
each
(
function
()
{
self
.
offsets
.
push
(
this
[
0
])
self
.
targets
.
push
(
this
[
1
])
})
this
.
offsets
=
$
.
map
(
this
.
targets
,
function
(
id
)
{
return
$
(
id
).
position
().
top
})
}
,
process
:
function
()
{
var
scrollTop
=
this
.
$scrollElement
.
scrollTop
()
+
this
.
options
.
offset
,
scrollHeight
=
this
.
$scrollElement
[
0
].
scrollHeight
||
this
.
$body
[
0
].
scrollHeight
,
maxScroll
=
scrollHeight
-
this
.
$scrollElement
.
height
()
,
offsets
=
this
.
offsets
,
targets
=
this
.
targets
,
activeTarget
=
this
.
activeTarget
,
i
if
(
scrollTop
>=
maxScroll
)
{
return
activeTarget
!=
(
i
=
targets
.
last
()[
0
])
&&
this
.
activate
(
i
)
}
for
(
i
=
offsets
.
length
;
i
--
;)
{
activeTarget
!=
targets
[
i
]
&&
scrollTop
>=
offsets
[
i
]
...
...
@@ -85,8 +102,10 @@
.
addClass
(
'
active
'
)
if
(
active
.
parent
(
'
.dropdown-menu
'
)
)
{
active
.
closest
(
'
li.dropdown
'
).
addClass
(
'
active
'
)
active
=
active
.
closest
(
'
li.dropdown
'
).
addClass
(
'
active
'
)
}
active
.
trigger
(
'
activate
'
)
}
}
...
...
This diff is collapsed.
Click to expand it.
docs/assets/js/bootstrap-tooltip.js
+
4
-
4
View file @
f87e4c60
...
...
@@ -73,8 +73,9 @@
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
show
)
{
self
.
show
()
}
else
{
clearTimeout
(
this
.
timeout
)
self
.
hoverState
=
'
in
'
setTimeout
(
function
()
{
this
.
timeout
=
setTimeout
(
function
()
{
if
(
self
.
hoverState
==
'
in
'
)
{
self
.
show
()
}
...
...
@@ -88,8 +89,9 @@
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
hide
)
{
self
.
hide
()
}
else
{
clearTimeout
(
this
.
timeout
)
self
.
hoverState
=
'
out
'
setTimeout
(
function
()
{
this
.
timeout
=
setTimeout
(
function
()
{
if
(
self
.
hoverState
==
'
out
'
)
{
self
.
hide
()
}
...
...
@@ -206,8 +208,6 @@
title
=
$e
.
attr
(
'
data-original-title
'
)
||
(
typeof
o
.
title
==
'
function
'
?
o
.
title
.
call
(
$e
[
0
])
:
o
.
title
)
title
=
(
title
||
''
).
toString
().
replace
(
/
(
^
\s
*|
\s
*$
)
/
,
""
)
return
title
}
...
...
This diff is collapsed.
Click to expand it.
docs/assets/js/bootstrap-typeahead.js
+
5
-
3
View file @
f87e4c60
...
...
@@ -39,8 +39,9 @@
,
select
:
function
()
{
var
val
=
this
.
$menu
.
find
(
'
.active
'
).
attr
(
'
data-value
'
)
this
.
$element
.
val
(
val
)
this
.
$element
.
change
();
this
.
$element
.
val
(
val
)
.
change
()
return
this
.
hide
()
}
...
...
@@ -109,7 +110,8 @@
}
,
highlighter
:
function
(
item
)
{
return
item
.
replace
(
new
RegExp
(
'
(
'
+
this
.
query
+
'
)
'
,
'
ig
'
),
function
(
$1
,
match
)
{
var
query
=
this
.
query
.
replace
(
/
[
-[
\]
{}()*+?.,
\\
^$|#
\s]
/g
,
'
\\
$&
'
)
return
item
.
replace
(
new
RegExp
(
'
(
'
+
query
+
'
)
'
,
'
ig
'
),
function
(
$1
,
match
)
{
return
'
<strong>
'
+
match
+
'
</strong>
'
})
}
...
...
This diff is collapsed.
Click to expand it.
docs/javascript.html
+
16
-
1
View file @
f87e4c60
...
...
@@ -589,6 +589,21 @@ $('#myModal').on('hidden', function () {
</tr>
</tbody>
</table>
<h3>
Events
</h3>
<table
class=
"table table-bordered table-striped"
>
<thead>
<tr>
<th
style=
"width: 150px;"
>
Event
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
activate
</td>
<td>
This event fires whenever a new item becomes activated by the scrollspy.
</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
...
...
@@ -1320,7 +1335,7 @@ $('#myCollapsible').on('hidden', function () {
<td>
interval
</td>
<td>
number
</td>
<td>
5000
</td>
<td>
The amount of time to delay between automatically cycling an item.
</td>
<td>
The amount of time to delay between automatically cycling an item.
If false, carousel will not automatically cycle.
</td>
</tr>
<tr>
<td>
pause
</td>
...
...
This diff is collapsed.
Click to expand it.
docs/templates/pages/javascript.mustache
+
16
-
1
View file @
f87e4c60
...
...
@@ -513,6 +513,21 @@ $('#myModal').on('hidden', function () {
</tr>
</tbody>
</table>
<h3>
{{
_i
}}
Events
{{/
i
}}
</h3>
<table
class=
"table table-bordered table-striped"
>
<thead>
<tr>
<th
style=
"width: 150px;"
>
{{
_i
}}
Event
{{/
i
}}
</th>
<th>
{{
_i
}}
Description
{{/
i
}}
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
{{
_i
}}
activate
{{/
i
}}
</td>
<td>
{{
_i
}}
This event fires whenever a new item becomes activated by the scrollspy.
{{/
i
}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
...
...
@@ -1244,7 +1259,7 @@ $('#myCollapsible').on('hidden', function () {
<td>
{{
_i
}}
interval
{{/
i
}}
</td>
<td>
{{
_i
}}
number
{{/
i
}}
</td>
<td>
5000
</td>
<td>
{{
_i
}}
The amount of time to delay between automatically cycling an item.
{{/
i
}}
</td>
<td>
{{
_i
}}
The amount of time to delay between automatically cycling an item.
If false, carousel will not automatically cycle.
{{/
i
}}
</td>
</tr>
<tr>
<td>
{{
_i
}}
pause
{{/
i
}}
</td>
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-carousel.js
+
12
-
11
View file @
f87e4c60
...
...
@@ -27,7 +27,7 @@
var
Carousel
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
)
this
.
options
=
$
.
extend
({},
$
.
fn
.
carousel
.
defaults
,
options
)
this
.
options
=
options
this
.
options
.
slide
&&
this
.
slide
(
this
.
options
.
slide
)
this
.
options
.
pause
==
'
hover
'
&&
this
.
$element
.
on
(
'
mouseenter
'
,
$
.
proxy
(
this
.
pause
,
this
))
...
...
@@ -37,7 +37,8 @@
Carousel
.
prototype
=
{
cycle
:
function
()
{
this
.
interval
=
setInterval
(
$
.
proxy
(
this
.
next
,
this
),
this
.
options
.
interval
)
this
.
options
.
interval
&&
(
this
.
interval
=
setInterval
(
$
.
proxy
(
this
.
next
,
this
),
this
.
options
.
interval
))
return
this
}
...
...
@@ -94,13 +95,7 @@
if
(
$next
.
hasClass
(
'
active
'
))
return
if
(
!
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
this
.
$element
.
trigger
(
'
slide
'
)
$active
.
removeClass
(
'
active
'
)
$next
.
addClass
(
'
active
'
)
this
.
sliding
=
false
this
.
$element
.
trigger
(
'
slid
'
)
}
else
{
if
(
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
$next
.
addClass
(
type
)
$next
[
0
].
offsetWidth
// force reflow
$active
.
addClass
(
direction
)
...
...
@@ -112,6 +107,12 @@
that
.
sliding
=
false
setTimeout
(
function
()
{
that
.
$element
.
trigger
(
'
slid
'
)
},
0
)
})
}
else
{
this
.
$element
.
trigger
(
'
slide
'
)
$active
.
removeClass
(
'
active
'
)
$next
.
addClass
(
'
active
'
)
this
.
sliding
=
false
this
.
$element
.
trigger
(
'
slid
'
)
}
isCycling
&&
this
.
cycle
()
...
...
@@ -129,11 +130,11 @@
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
carousel
'
)
,
options
=
typeof
option
==
'
object
'
&&
option
,
options
=
$
.
extend
({},
$
.
fn
.
carousel
.
defaults
,
typeof
option
==
'
object
'
&&
option
)
if
(
!
data
)
$this
.
data
(
'
carousel
'
,
(
data
=
new
Carousel
(
this
,
options
)))
if
(
typeof
option
==
'
number
'
)
data
.
to
(
option
)
else
if
(
typeof
option
==
'
string
'
||
(
option
=
options
.
slide
))
data
[
option
]()
else
data
.
cycle
()
else
if
(
options
.
interval
)
data
.
cycle
()
})
}
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-collapse.js
+
17
-
6
View file @
f87e4c60
...
...
@@ -42,11 +42,18 @@
}
,
show
:
function
()
{
var
dimension
=
this
.
dimension
()
,
scroll
=
$
.
camelCase
([
'
scroll
'
,
dimension
].
join
(
'
-
'
))
,
actives
=
this
.
$parent
&&
this
.
$parent
.
find
(
'
.in
'
)
var
dimension
,
scroll
,
actives
,
hasData
if
(
this
.
transitioning
)
return
dimension
=
this
.
dimension
()
scroll
=
$
.
camelCase
([
'
scroll
'
,
dimension
].
join
(
'
-
'
))
actives
=
this
.
$parent
&&
this
.
$parent
.
find
(
'
> .accordion-group > .in
'
)
hasData
if
(
actives
&&
actives
.
length
)
{
hasData
=
actives
.
data
(
'
collapse
'
)
actives
.
collapse
(
'
hide
'
)
...
...
@@ -56,11 +63,12 @@
this
.
$element
[
dimension
](
0
)
this
.
transition
(
'
addClass
'
,
'
show
'
,
'
shown
'
)
this
.
$element
[
dimension
](
this
.
$element
[
0
][
scroll
])
}
,
hide
:
function
()
{
var
dimension
=
this
.
dimension
()
var
dimension
if
(
this
.
transitioning
)
return
dimension
=
this
.
dimension
()
this
.
reset
(
this
.
$element
[
dimension
]())
this
.
transition
(
'
removeClass
'
,
'
hide
'
,
'
hidden
'
)
this
.
$element
[
dimension
](
0
)
...
...
@@ -74,7 +82,7 @@
[
dimension
](
size
||
'
auto
'
)
[
0
].
offsetWidth
this
.
$element
[
size
?
'
addClass
'
:
'
removeClass
'
](
'
collapse
'
)
this
.
$element
[
size
!=
null
?
'
addClass
'
:
'
removeClass
'
](
'
collapse
'
)
return
this
}
...
...
@@ -83,9 +91,12 @@
var
that
=
this
,
complete
=
function
()
{
if
(
startEvent
==
'
show
'
)
that
.
reset
()
that
.
transitioning
=
0
that
.
$element
.
trigger
(
completeEvent
)
}
this
.
transitioning
=
1
this
.
$element
.
trigger
(
startEvent
)
[
method
](
'
in
'
)
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-dropdown.js
+
3
-
1
View file @
f87e4c60
...
...
@@ -86,7 +86,9 @@
$
(
function
()
{
$
(
'
html
'
).
on
(
'
click.dropdown.data-api
'
,
clearMenus
)
$
(
'
body
'
).
on
(
'
click.dropdown.data-api
'
,
toggle
,
Dropdown
.
prototype
.
toggle
)
$
(
'
body
'
)
.
on
(
'
click.dropdown
'
,
'
.dropdown form
'
,
function
(
e
)
{
e
.
stopPropagation
()
})
.
on
(
'
click.dropdown.data-api
'
,
toggle
,
Dropdown
.
prototype
.
toggle
)
})
}(
window
.
jQuery
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/bootstrap-popover.js
+
2
-
4
View file @
f87e4c60
...
...
@@ -38,8 +38,8 @@
,
title
=
this
.
getTitle
()
,
content
=
this
.
getContent
()
$tip
.
find
(
'
.popover-title
'
)
[
$
.
type
(
title
)
==
'
object
'
?
'
append
'
:
'
html
'
]
(
title
)
$tip
.
find
(
'
.popover-content > *
'
)
[
$
.
type
(
content
)
==
'
object
'
?
'
append
'
:
'
html
'
]
(
content
)
$tip
.
find
(
'
.popover-title
'
)
.
html
(
title
)
$tip
.
find
(
'
.popover-content > *
'
)
.
html
(
content
)
$tip
.
removeClass
(
'
fade top bottom left right in
'
)
}
...
...
@@ -56,8 +56,6 @@
content
=
$e
.
attr
(
'
data-content
'
)
||
(
typeof
o
.
content
==
'
function
'
?
o
.
content
.
call
(
$e
[
0
])
:
o
.
content
)
content
=
content
.
toString
().
replace
(
/
(
^
\s
*|
\s
*$
)
/
,
""
)
return
content
}
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-scrollspy.js
+
26
-
7
View file @
f87e4c60
...
...
@@ -43,25 +43,42 @@
constructor
:
ScrollSpy
,
refresh
:
function
()
{
this
.
targets
=
this
.
$body
var
self
=
this
,
$targets
this
.
offsets
=
[]
this
.
targets
=
[]
$targets
=
this
.
$body
.
find
(
this
.
selector
)
.
map
(
function
()
{
var
href
=
$
(
this
).
attr
(
'
href
'
)
return
/^#
\w
/
.
test
(
href
)
&&
$
(
href
).
length
?
href
:
null
,
$href
=
/^#
\w
/
.
test
(
href
)
&&
$
(
href
)
return
(
$href
&&
href
.
length
&&
[[
$href
.
position
().
top
,
href
]]
)
||
null
})
.
sort
(
function
(
a
,
b
)
{
return
a
[
0
]
-
b
[
0
]
})
.
each
(
function
()
{
self
.
offsets
.
push
(
this
[
0
])
self
.
targets
.
push
(
this
[
1
])
})
this
.
offsets
=
$
.
map
(
this
.
targets
,
function
(
id
)
{
return
$
(
id
).
position
().
top
})
}
,
process
:
function
()
{
var
scrollTop
=
this
.
$scrollElement
.
scrollTop
()
+
this
.
options
.
offset
,
scrollHeight
=
this
.
$scrollElement
[
0
].
scrollHeight
||
this
.
$body
[
0
].
scrollHeight
,
maxScroll
=
scrollHeight
-
this
.
$scrollElement
.
height
()
,
offsets
=
this
.
offsets
,
targets
=
this
.
targets
,
activeTarget
=
this
.
activeTarget
,
i
if
(
scrollTop
>=
maxScroll
)
{
return
activeTarget
!=
(
i
=
targets
.
last
()[
0
])
&&
this
.
activate
(
i
)
}
for
(
i
=
offsets
.
length
;
i
--
;)
{
activeTarget
!=
targets
[
i
]
&&
scrollTop
>=
offsets
[
i
]
...
...
@@ -85,8 +102,10 @@
.
addClass
(
'
active
'
)
if
(
active
.
parent
(
'
.dropdown-menu
'
)
)
{
active
.
closest
(
'
li.dropdown
'
).
addClass
(
'
active
'
)
active
=
active
.
closest
(
'
li.dropdown
'
).
addClass
(
'
active
'
)
}
active
.
trigger
(
'
activate
'
)
}
}
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-tooltip.js
+
4
-
4
View file @
f87e4c60
...
...
@@ -73,8 +73,9 @@
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
show
)
{
self
.
show
()
}
else
{
clearTimeout
(
this
.
timeout
)
self
.
hoverState
=
'
in
'
setTimeout
(
function
()
{
this
.
timeout
=
setTimeout
(
function
()
{
if
(
self
.
hoverState
==
'
in
'
)
{
self
.
show
()
}
...
...
@@ -88,8 +89,9 @@
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
hide
)
{
self
.
hide
()
}
else
{
clearTimeout
(
this
.
timeout
)
self
.
hoverState
=
'
out
'
setTimeout
(
function
()
{
this
.
timeout
=
setTimeout
(
function
()
{
if
(
self
.
hoverState
==
'
out
'
)
{
self
.
hide
()
}
...
...
@@ -206,8 +208,6 @@
title
=
$e
.
attr
(
'
data-original-title
'
)
||
(
typeof
o
.
title
==
'
function
'
?
o
.
title
.
call
(
$e
[
0
])
:
o
.
title
)
title
=
(
title
||
''
).
toString
().
replace
(
/
(
^
\s
*|
\s
*$
)
/
,
""
)
return
title
}
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-typeahead.js
+
5
-
3
View file @
f87e4c60
...
...
@@ -39,8 +39,9 @@
,
select
:
function
()
{
var
val
=
this
.
$menu
.
find
(
'
.active
'
).
attr
(
'
data-value
'
)
this
.
$element
.
val
(
val
)
this
.
$element
.
change
();
this
.
$element
.
val
(
val
)
.
change
()
return
this
.
hide
()
}
...
...
@@ -109,7 +110,8 @@
}
,
highlighter
:
function
(
item
)
{
return
item
.
replace
(
new
RegExp
(
'
(
'
+
this
.
query
+
'
)
'
,
'
ig
'
),
function
(
$1
,
match
)
{
var
query
=
this
.
query
.
replace
(
/
[
-[
\]
{}()*+?.,
\\
^$|#
\s]
/g
,
'
\\
$&
'
)
return
item
.
replace
(
new
RegExp
(
'
(
'
+
query
+
'
)
'
,
'
ig
'
),
function
(
$1
,
match
)
{
return
'
<strong>
'
+
match
+
'
</strong>
'
})
}
...
...
This diff is collapsed.
Click to expand it.
js/tests/index.html
+
1
-
1
View file @
f87e4c60
...
...
@@ -36,7 +36,7 @@
<script
src=
"unit/bootstrap-tooltip.js"
></script>
<script
src=
"unit/bootstrap-popover.js"
></script>
<script
src=
"unit/bootstrap-typeahead.js"
></script>
</head>
<body>
<div>
<h1
id=
"qunit-header"
>
Bootstrap Plugin Test Suite
</h1>
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/bootstrap-typeahead.js
+
16
-
0
View file @
f87e4c60
...
...
@@ -52,6 +52,22 @@ $(function () {
typeahead
.
$menu
.
remove
()
})
test
(
"
should not explode when regex chars are entered
"
,
function
()
{
var
$input
=
$
(
'
<input />
'
).
typeahead
({
source
:
[
'
aa
'
,
'
ab
'
,
'
ac
'
,
'
mdo*
'
,
'
fat+
'
]
})
,
typeahead
=
$input
.
data
(
'
typeahead
'
)
$input
.
val
(
'
+
'
)
typeahead
.
lookup
()
ok
(
typeahead
.
$menu
.
is
(
"
:visible
"
),
'
typeahead is visible
'
)
equals
(
typeahead
.
$menu
.
find
(
'
li
'
).
length
,
1
,
'
has 1 item in menu
'
)
equals
(
typeahead
.
$menu
.
find
(
'
.active
'
).
length
,
1
,
'
one item is active
'
)
typeahead
.
$menu
.
remove
()
})
test
(
"
should hide menu when query entered
"
,
function
()
{
stop
()
var
$input
=
$
(
'
<input />
'
).
typeahead
({
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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