0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-19 16:54:24 +01:00

Only preventDefault on click on [data-toggle="modal"] when the element is a link

In it's current state Bootstrap always prevents the default action for a click
event on `[data-toggle="modal"]` elements
(see https://github.com/twbs/bootstrap/blob/master/js/modal.js#L233).
Instead this should only happen when the element is a link.
This commit is contained in:
Alexander Prinzhorn 2013-09-27 11:32:06 +02:00
parent eb3807609a
commit 12a3bb31f8

View File

@ -230,7 +230,7 @@
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
e.preventDefault()
if ($this.is('a')) e.preventDefault()
$target
.modal(option, this)