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
bcd5097c
Commit
bcd5097c
authored
May 31, 2012
by
Jacob Thornton
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3655 from jorgenfb/
8dda8390
Updated unit test for tooltips. Now using is() instead of hasClass()
parents
7875e483
8dda8390
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
10 deletions
+29
-10
js/bootstrap-tooltip.js
js/bootstrap-tooltip.js
+2
-2
js/tests/unit/bootstrap-tooltip.js
js/tests/unit/bootstrap-tooltip.js
+27
-8
No files found.
js/bootstrap-tooltip.js
View file @
bcd5097c
...
@@ -84,9 +84,9 @@
...
@@ -84,9 +84,9 @@
,
leave
:
function
(
e
)
{
,
leave
:
function
(
e
)
{
var
self
=
$
(
e
.
currentTarget
)[
this
.
type
](
this
.
_options
).
data
(
this
.
type
)
var
self
=
$
(
e
.
currentTarget
)[
this
.
type
](
this
.
_options
).
data
(
this
.
type
)
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
hide
)
return
self
.
hide
()
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
hide
)
return
self
.
hide
()
clearTimeout
(
this
.
timeout
)
self
.
hoverState
=
'
out
'
self
.
hoverState
=
'
out
'
this
.
timeout
=
setTimeout
(
function
()
{
this
.
timeout
=
setTimeout
(
function
()
{
if
(
self
.
hoverState
==
'
out
'
)
self
.
hide
()
if
(
self
.
hoverState
==
'
out
'
)
self
.
hide
()
...
@@ -272,4 +272,4 @@
...
@@ -272,4 +272,4 @@
,
delay
:
0
,
delay
:
0
}
}
}(
window
.
jQuery
);
}(
window
.
jQuery
);
\ No newline at end of file
js/tests/unit/bootstrap-tooltip.js
View file @
bcd5097c
...
@@ -33,7 +33,7 @@ $(function () {
...
@@ -33,7 +33,7 @@ $(function () {
.
tooltip
({
placement
:
'
bottom
'
})
.
tooltip
({
placement
:
'
bottom
'
})
.
tooltip
(
'
show
'
)
.
tooltip
(
'
show
'
)
ok
(
$
(
"
.tooltip
"
).
hasClass
(
'
fade bottom
in
'
),
'
has correct classes applied
'
)
ok
(
$
(
"
.tooltip
"
).
is
(
'
.fade.bottom.
in
'
),
'
has correct classes applied
'
)
tooltip
.
tooltip
(
'
hide
'
)
tooltip
.
tooltip
(
'
hide
'
)
})
})
...
@@ -69,10 +69,29 @@ $(function () {
...
@@ -69,10 +69,29 @@ $(function () {
tooltip
.
trigger
(
'
mouseenter
'
)
tooltip
.
trigger
(
'
mouseenter
'
)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
ok
(
!
$
(
"
.tooltip
"
).
hasClass
(
'
fade
in
'
),
'
tooltip is not faded in
'
)
ok
(
!
$
(
"
.tooltip
"
).
is
(
'
.fade.
in
'
),
'
tooltip is not faded in
'
)
tooltip
.
trigger
(
'
mouseout
'
)
tooltip
.
trigger
(
'
mouseout
'
)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
ok
(
!
$
(
"
.tooltip
"
).
hasClass
(
'
fade in
'
),
'
tooltip is not faded in
'
)
ok
(
!
$
(
"
.tooltip
"
).
is
(
'
.fade.in
'
),
'
tooltip is not faded in
'
)
start
()
},
200
)
},
100
)
})
test
(
"
should not show tooltip if leave event occurs before delay expires, even if hide delay is 0
"
,
function
()
{
var
tooltip
=
$
(
'
<a href="#" rel="tooltip" title="Another tooltip"></a>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
tooltip
({
delay
:
{
show
:
200
,
hide
:
0
}
})
stop
()
tooltip
.
trigger
(
'
mouseenter
'
)
setTimeout
(
function
()
{
ok
(
!
$
(
"
.tooltip
"
).
is
(
'
.fade.in
'
),
'
tooltip is not faded in
'
)
tooltip
.
trigger
(
'
mouseout
'
)
setTimeout
(
function
()
{
ok
(
!
$
(
"
.tooltip
"
).
is
(
'
.fade.in
'
),
'
tooltip is not faded in
'
)
start
()
start
()
},
200
)
},
200
)
},
100
)
},
100
)
...
@@ -85,10 +104,10 @@ $(function () {
...
@@ -85,10 +104,10 @@ $(function () {
stop
()
stop
()
tooltip
.
trigger
(
'
mouseenter
'
)
tooltip
.
trigger
(
'
mouseenter
'
)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
ok
(
!
$
(
"
.tooltip
"
).
hasClass
(
'
fade
in
'
),
'
tooltip is not faded in
'
)
ok
(
!
$
(
"
.tooltip
"
).
is
(
'
.fade.
in
'
),
'
tooltip is not faded in
'
)
tooltip
.
trigger
(
'
mouseout
'
)
tooltip
.
trigger
(
'
mouseout
'
)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
ok
(
!
$
(
"
.tooltip
"
).
hasClass
(
'
fade
in
'
),
'
tooltip is not faded in
'
)
ok
(
!
$
(
"
.tooltip
"
).
is
(
'
.fade.
in
'
),
'
tooltip is not faded in
'
)
start
()
start
()
},
100
)
},
100
)
},
50
)
},
50
)
...
@@ -101,9 +120,9 @@ $(function () {
...
@@ -101,9 +120,9 @@ $(function () {
stop
()
stop
()
tooltip
.
trigger
(
'
mouseenter
'
)
tooltip
.
trigger
(
'
mouseenter
'
)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
ok
(
!
$
(
"
.tooltip
"
).
hasClass
(
'
fade
in
'
),
'
tooltip is not faded in
'
)
ok
(
!
$
(
"
.tooltip
"
).
is
(
'
.fade.
in
'
),
'
tooltip is not faded in
'
)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
ok
(
!
$
(
"
.tooltip
"
).
hasClass
(
'
fade
in
'
),
'
tooltip has faded in
'
)
ok
(
!
$
(
"
.tooltip
"
).
is
(
'
.fade.
in
'
),
'
tooltip has faded in
'
)
start
()
start
()
},
200
)
},
200
)
},
100
)
},
100
)
...
@@ -133,4 +152,4 @@ $(function () {
...
@@ -133,4 +152,4 @@ $(function () {
ok
(
$
.
fn
.
tooltip
.
Constructor
.
prototype
.
isHTML
(
$
(
'
<div></div>
'
)),
'
correctly detected html
'
)
ok
(
$
.
fn
.
tooltip
.
Constructor
.
prototype
.
isHTML
(
$
(
'
<div></div>
'
)),
'
correctly detected html
'
)
})
})
})
})
\ No newline at end of file
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