diff options
author | Carl Porth <badcarl@gmail.com> | 2012-09-28 02:00:02 +0400 |
---|---|---|
committer | Carl Porth <badcarl@gmail.com> | 2012-09-28 02:00:02 +0400 |
commit | e1f6458e3640a628cdb6b2e4c63950777d46e141 (patch) | |
tree | cf4f67f4a214999cfb5024f6fbe12697b2c3cc17 /js/bootstrap-modal.js | |
parent | 474471b83140350de320f3ba940bd7dd8326b32e (diff) |
don't wait for ready when binding events to document
Diffstat (limited to 'js/bootstrap-modal.js')
-rw-r--r-- | js/bootstrap-modal.js | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 8a40c2d4e6..0030ad7c50 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -215,21 +215,19 @@ /* MODAL DATA-API * ============== */ - $(function () { - $(document).on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) { - var $this = $(this) - , href = $this.attr('href') - , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 - , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) - - e.preventDefault() - - $target - .modal(option) - .one('hide', function () { - $this.focus() - }) - }) + $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) { + var $this = $(this) + , href = $this.attr('href') + , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 + , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data()) + + e.preventDefault() + + $target + .modal(option) + .one('hide', function () { + $this.focus() + }) }) }(window.jQuery);
\ No newline at end of file |