Commit 12a3bb31 authored by Alexander Prinzhorn's avatar Alexander Prinzhorn
Browse files

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.
parent eb380760
Showing with 1 addition and 1 deletion
+1 -1
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 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()) var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
e.preventDefault() if ($this.is('a')) e.preventDefault()
$target $target
.modal(option, this) .modal(option, this)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment