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
9dc3cf7f
Commit
9dc3cf7f
authored
Dec 29, 2014
by
Chris Rebert
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15425 from twbs/regression-test-14244
Add regression test for #14244.
parents
e4c7a92c
27bfef5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
js/tests/unit/popover.js
js/tests/unit/popover.js
+38
-0
No files found.
js/tests/unit/popover.js
View file @
9dc3cf7f
...
...
@@ -217,4 +217,42 @@ $(function () {
$div
.
find
(
'
a.second
'
).
click
()
equal
(
$
(
'
.popover
'
).
length
,
0
,
'
second popover removed
'
)
})
test
(
'
should detach popover content rather than removing it so that event handlers are left intact
'
,
function
()
{
var
$content
=
$
(
'
<div class="content-with-handler"><a class="btn btn-warning">Button with event handler</a></div>
'
).
appendTo
(
'
#qunit-fixture
'
)
var
handlerCalled
=
false
;
$
(
'
.content-with-handler .btn
'
).
click
(
function
()
{
handlerCalled
=
true
});
var
$div
=
$
(
'
<div><a href="#">Show popover</a></div>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
bootstrapPopover
({
html
:
true
,
trigger
:
'
manual
'
,
container
:
'
body
'
,
content
:
function
()
{
return
$content
;
}
})
stop
()
$div
.
one
(
'
shown.bs.popover
'
,
function
()
{
$div
.
one
(
'
hidden.bs.popover
'
,
function
()
{
$div
.
one
(
'
shown.bs.popover
'
,
function
()
{
$
(
'
.content-with-handler .btn
'
).
click
()
$div
.
bootstrapPopover
(
'
destroy
'
)
ok
(
handlerCalled
,
'
content
\'
s event handler still present
'
)
start
()
})
.
bootstrapPopover
(
'
show
'
)
})
.
bootstrapPopover
(
'
hide
'
)
})
.
bootstrapPopover
(
'
show
'
)
})
})
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