]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Only preventDefault on click on [data-toggle="modal"] when the element is a link 10834/head
authorAlexander Prinzhorn <alex@nder-prinzhorn.de>
Fri, 27 Sep 2013 09:32:06 +0000 (11:32 +0200)
committerAlexander Prinzhorn <alex@nder-prinzhorn.de>
Fri, 27 Sep 2013 09:32:06 +0000 (11:32 +0200)
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.

js/modal.js

index 65eba481e531acb1c36e490f4c21d2179f510b2b..349431d9980f75851d70deff23d542c612e1e917 100644 (file)
     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)