From 08b8571cb842e9fc668d9faf6c305a51523b27fb Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 5 Sep 2012 10:00:57 -0700 Subject: version bump to get this started --- js/bootstrap-modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-modal.js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index f1622b1c6..041274c5b 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -1,5 +1,5 @@ /* ========================================================= - * bootstrap-modal.js v2.1.1 + * bootstrap-modal.js v2.1.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= * Copyright 2012 Twitter, Inc. -- cgit v1.2.3 From 88b1e44dd61afd8f08761346555521bd216ed73a Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 24 Sep 2012 23:28:38 -0700 Subject: change tooltip/popover insert strategy remove modal-open class hopefully resolve z-index headaches --- js/bootstrap-modal.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'js/bootstrap-modal.js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 041274c5b..d53f13a00 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -49,8 +49,6 @@ if (this.isShown || e.isDefaultPrevented()) return - $('body').addClass('modal-open') - this.isShown = true this.escape() @@ -96,8 +94,6 @@ this.isShown = false - $('body').removeClass('modal-open') - this.escape() $(document).off('focusin.modal') -- cgit v1.2.3 From 474471b83140350de320f3ba940bd7dd8326b32e Mon Sep 17 00:00:00 2001 From: Carl Porth Date: Wed, 26 Sep 2012 23:11:03 -0700 Subject: bind data-api events to document instead of body to allow body replacement --- js/bootstrap-modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-modal.js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index d53f13a00..8a40c2d4e 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -216,7 +216,7 @@ * ============== */ $(function () { - $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) { + $(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 -- cgit v1.2.3 From e1f6458e3640a628cdb6b2e4c63950777d46e141 Mon Sep 17 00:00:00 2001 From: Carl Porth Date: Thu, 27 Sep 2012 15:00:02 -0700 Subject: don't wait for ready when binding events to document --- js/bootstrap-modal.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'js/bootstrap-modal.js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 8a40c2d4e..0030ad7c5 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 -- cgit v1.2.3 From e24b46b7f3fb9eab5f34fb6e199d24781204c745 Mon Sep 17 00:00:00 2001 From: mfansler Date: Tue, 16 Oct 2012 12:27:43 -0400 Subject: fixes #5336: reorder focus() call to avoid scrolling --- js/bootstrap-modal.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'js/bootstrap-modal.js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index d53f13a00..d2a4878b3 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -70,13 +70,12 @@ that.$element .addClass('in') .attr('aria-hidden', false) - .focus() that.enforceFocus() transition ? - that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : - that.$element.trigger('shown') + that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : + that.$element.focus().trigger('shown') }) } @@ -232,4 +231,4 @@ }) }) -}(window.jQuery); \ No newline at end of file +}(window.jQuery); -- cgit v1.2.3 From 45046544a671b5bb27f1631c9a1bef453b3ca325 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 17 Oct 2012 23:36:22 -0700 Subject: when static, refocus on click --- js/bootstrap-modal.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'js/bootstrap-modal.js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 185519aaf..57284dd78 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -162,9 +162,11 @@ this.$backdrop = $('