Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
6b017b9b
Commit
6b017b9b
authored
12 years ago
by
Martin Stein
Browse files
Options
Download
Email Patches
Plain Diff
fixed reference to this.tip() so it works in delegate events
parent
fa778792
1 merge request
!5524
Fix tooltip not working in delegate events on click-trigger
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/bootstrap-tooltip.js
+3
-2
js/bootstrap-tooltip.js
js/tests/unit/bootstrap-tooltip.js
+8
-0
js/tests/unit/bootstrap-tooltip.js
with
11 additions
and
2 deletions
+11
-2
js/bootstrap-tooltip.js
+
3
-
2
View file @
6b017b9b
...
...
@@ -235,8 +235,9 @@
this
.
enabled
=
!
this
.
enabled
}
,
toggle
:
function
()
{
this
[
this
.
tip
().
hasClass
(
'
in
'
)
?
'
hide
'
:
'
show
'
]()
,
toggle
:
function
(
e
)
{
var
self
=
$
(
e
.
currentTarget
)[
this
.
type
](
this
.
_options
).
data
(
this
.
type
)
self
[
self
.
tip
().
hasClass
(
'
in
'
)
?
'
hide
'
:
'
show
'
]()
}
,
destroy
:
function
()
{
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/bootstrap-tooltip.js
+
8
-
0
View file @
6b017b9b
...
...
@@ -142,4 +142,12 @@ $(function () {
ok
(
!
$
.
_data
(
tooltip
[
0
],
'
events
'
).
mouseover
&&
!
$
.
_data
(
tooltip
[
0
],
'
events
'
).
mouseout
,
'
tooltip does not have any events
'
)
})
test
(
"
should show tooltip with delegate selector on click
"
,
function
()
{
var
div
=
$
(
'
<div><a href="#" rel="tooltip" title="Another tooltip"></a></div>
'
)
var
tooltip
=
div
.
appendTo
(
'
#qunit-fixture
'
)
.
tooltip
({
selector
:
'
a[rel=tooltip]
'
,
trigger
:
'
click
'
})
div
.
find
(
'
a
'
).
trigger
(
'
click
'
)
ok
(
$
(
"
.tooltip
"
).
is
(
'
.fade.in
'
),
'
tooltip is faded in
'
)
})
})
\ No newline at end of file
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
Menu
Explore
Projects
Groups
Snippets