diff options
| author | Mark Otto <[email protected]> | 2012-08-01 20:34:29 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2012-08-01 20:34:29 -0700 |
| commit | 4a84145c4328daf17f06704100671b7a0b6ee329 (patch) | |
| tree | e08c25e1098ed638ea81f9a547eaf735d6c41471 /docs/assets/js/bootstrap.js | |
| parent | 86a577d76bd1dcd226dad90899886dbe18d36e39 (diff) | |
| parent | 48546c2735f445618fc3972a752393417d17ebb3 (diff) | |
| download | bootstrap-4a84145c4328daf17f06704100671b7a0b6ee329.tar.xz bootstrap-4a84145c4328daf17f06704100671b7a0b6ee329.zip | |
Merge branch '2.1.0-wip' of github.com:twitter/bootstrap into 2.1.0-wip
Diffstat (limited to 'docs/assets/js/bootstrap.js')
| -rw-r--r-- | docs/assets/js/bootstrap.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 6024ffbf3..1a02eac15 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -793,7 +793,10 @@ that.$element[0].offsetWidth // force reflow } - that.$element.addClass('in') + that.$element + .addClass('in') + .attr('aria-hidden', false) + .focus() that.enforceFocus() @@ -823,7 +826,9 @@ $(document).off('focusin.modal') - this.$element.removeClass('in') + this.$element + .removeClass('in') + .attr('aria-hidden', true) $.support.transition && this.$element.hasClass('fade') ? this.hideWithTransition() : @@ -842,11 +847,11 @@ , escape: function () { var that = this if (this.isShown && this.options.keyboard) { - $(document).on('keyup.dismiss.modal', function ( e ) { + this.$element.on('keyup.dismiss.modal', function ( e ) { e.which == 27 && that.hide() }) } else if (!this.isShown) { - $(document).off('keyup.dismiss.modal') + this.$element.off('keyup.dismiss.modal') } } @@ -946,7 +951,12 @@ , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) e.preventDefault() - $target.modal(option) + + $target + .modal(option) + .one('hide', function () { + $this.focus() + }) }) }) |
