diff options
| author | Alexander Prinzhorn <[email protected]> | 2013-09-27 11:32:06 +0200 |
|---|---|---|
| committer | Alexander Prinzhorn <[email protected]> | 2013-09-27 11:32:06 +0200 |
| commit | 12a3bb31f82b7fee96dbd5d91f4a5bef90c7acd6 (patch) | |
| tree | faff48b14e548e028c5a8e1dbffebe5ea42a8e1e | |
| parent | eb3807609a936ba7fb6b032395c07071ab46beac (diff) | |
| download | bootstrap-12a3bb31f82b7fee96dbd5d91f4a5bef90c7acd6.tar.xz bootstrap-12a3bb31f82b7fee96dbd5d91f4a5bef90c7acd6.zip | |
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.
| -rw-r--r-- | js/modal.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/js/modal.js b/js/modal.js index 65eba481e..349431d99 100644 --- a/js/modal.js +++ b/js/modal.js @@ -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) |
