-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prevent navigating to area href when modal target #20462
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,4 +403,26 @@ $(function () { | |
}) | ||
.bootstrapModal('show') | ||
}) | ||
|
||
QUnit.test('should not follow link in area tag', function (assert) { | ||
assert.expect(2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No magic number: 2 no-magic-numbers |
||
var done = assert.async() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unexpected var, use let or const instead no-var |
||
|
||
$('<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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unexpected function expression prefer-arrow-callback |
||
assert.notOk(event.isDefaultPrevented(), 'navigating to href will happen') | ||
|
||
setTimeout(function () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unexpected function expression prefer-arrow-callback |
||
assert.ok(event.isDefaultPrevented(), 'model shown instead of navigating to href') | ||
done() | ||
}, 1) | ||
}) | ||
.trigger('click') | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'QUnit' is not defined no-undef
Unexpected function expression prefer-arrow-callback