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
27bbc7db
Commit
27bbc7db
authored
Mar 03, 2015
by
Chris Rebert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hiding an uninitialized tooltip/popover no longer initializes it; fixes #15874
parent
2f17289a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
2 deletions
+26
-2
js/popover.js
js/popover.js
+1
-1
js/tests/unit/popover.js
js/tests/unit/popover.js
+12
-0
js/tests/unit/tooltip.js
js/tests/unit/tooltip.js
+12
-0
js/tooltip.js
js/tooltip.js
+1
-1
No files found.
js/popover.js
View file @
27bbc7db
...
...
@@ -85,7 +85,7 @@
var
data
=
$this
.
data
(
'
bs.popover
'
)
var
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
&&
option
==
'
destroy
'
)
return
if
(
!
data
&&
/destroy|hide/
.
test
(
option
)
)
return
if
(
!
data
)
$this
.
data
(
'
bs.popover
'
,
(
data
=
new
Popover
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
...
...
js/tests/unit/popover.js
View file @
27bbc7db
...
...
@@ -247,4 +247,16 @@ $(function () {
},
new
Error
(
'
`selector` option must be specified when initializing popover on the window.document object!
'
))
})
QUnit
.
test
(
'
should do nothing when an attempt is made to hide an uninitialized popover
'
,
function
(
assert
)
{
assert
.
expect
(
1
)
var
$popover
=
$
(
'
<span data-toggle="popover" data-title="some title" data-content="some content">some text</span>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
on
(
'
hidden.bs.popover shown.bs.popover
'
,
function
()
{
assert
.
ok
(
false
,
'
should not fire any popover events
'
)
})
.
bootstrapPopover
(
'
hide
'
)
assert
.
strictEqual
(
$popover
.
data
(
'
bs.popover
'
),
undefined
,
'
should not initialize the popover
'
)
})
})
js/tests/unit/tooltip.js
View file @
27bbc7db
...
...
@@ -1168,4 +1168,16 @@ $(function () {
},
new
Error
(
'
`selector` option must be specified when initializing tooltip on the window.document object!
'
))
})
QUnit
.
test
(
'
should do nothing when an attempt is made to hide an uninitialized tooltip
'
,
function
(
assert
)
{
assert
.
expect
(
1
)
var
$tooltip
=
$
(
'
<span data-toggle="tooltip" title="some tip">some text</span>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
on
(
'
hidden.bs.tooltip shown.bs.tooltip
'
,
function
()
{
assert
.
ok
(
false
,
'
should not fire any tooltip events
'
)
})
.
bootstrapTooltip
(
'
hide
'
)
assert
.
strictEqual
(
$tooltip
.
data
(
'
bs.tooltip
'
),
undefined
,
'
should not initialize the tooltip
'
)
})
})
js/tooltip.js
View file @
27bbc7db
...
...
@@ -453,7 +453,7 @@
var
data
=
$this
.
data
(
'
bs.tooltip
'
)
var
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
&&
option
==
'
destroy
'
)
return
if
(
!
data
&&
/destroy|hide/
.
test
(
option
)
)
return
if
(
!
data
)
$this
.
data
(
'
bs.tooltip
'
,
(
data
=
new
Tooltip
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
...
...
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