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
25d218b0
Commit
25d218b0
authored
8 years ago
by
Mark Otto
Browse files
Options
Download
Plain Diff
Merge branch 'v4-dev-18796' of
https://github.com/maxbeatty/bootstrap
into maxbeatty-v4-dev-18796
parents
cb294854
bfa714ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/src/modal.js
+1
-1
js/src/modal.js
js/tests/unit/modal.js
+22
-0
js/tests/unit/modal.js
with
23 additions
and
1 deletion
+23
-1
js/src/modal.js
+
1
-
1
View file @
25d218b0
...
...
@@ -489,7 +489,7 @@ const Modal = (($) => {
const
config
=
$
(
target
).
data
(
DATA_KEY
)
?
'
toggle
'
:
$
.
extend
({},
$
(
target
).
data
(),
$
(
this
).
data
())
if
(
this
.
tagName
===
'
A
'
)
{
if
(
this
.
tagName
===
'
A
'
||
this
.
tagName
===
'
AREA
'
)
{
event
.
preventDefault
()
}
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/modal.js
+
22
-
0
View file @
25d218b0
...
...
@@ -454,4 +454,26 @@ $(function () {
})
.
bootstrapModal
(
'
show
'
)
})
QUnit
.
test
(
'
should not follow link in area tag
'
,
function
(
assert
)
{
assert
.
expect
(
2
)
var
done
=
assert
.
async
()
$
(
'
<map><area id="test" shape="default" data-toggle="modal" data-target="#modal-test" href="demo.html"/></map>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
$
(
'
<div id="modal-test"><div class="contents"><div id="close" data-dismiss="modal"/></div></div>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
$
(
'
#test
'
)
.
on
(
'
click.bs.modal.data-api
'
,
function
(
event
)
{
assert
.
notOk
(
event
.
isDefaultPrevented
(),
'
navigating to href will happen
'
)
setTimeout
(
function
()
{
assert
.
ok
(
event
.
isDefaultPrevented
(),
'
model shown instead of navigating to href
'
)
done
()
},
1
)
})
.
trigger
(
'
click
'
)
})
})
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