From 66e5c761eea0ce48fcf72844f043db4bcb43c6d9 Mon Sep 17 00:00:00 2001 From: Thomas Park Date: Tue, 17 Mar 2015 14:23:20 -0400 Subject: update bootstrap 3.3.4 --- .../assets/javascripts/bootstrap/modal.js | 67 +++++++++++++--------- 1 file changed, 41 insertions(+), 26 deletions(-) (limited to 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/modal.js') diff --git a/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/modal.js b/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/modal.js index e7704b8f..c1eb2a85 100644 --- a/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/modal.js +++ b/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/modal.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: modal.js v3.3.2 + * Bootstrap: modal.js v3.3.4 * http://getbootstrap.com/javascript/#modals * ======================================================================== * Copyright 2011-2015 Twitter, Inc. @@ -14,12 +14,15 @@ // ====================== var Modal = function (element, options) { - this.options = options - this.$body = $(document.body) - this.$element = $(element) - this.$backdrop = - this.isShown = null - this.scrollbarWidth = 0 + this.options = options + this.$body = $(document.body) + this.$element = $(element) + this.$dialog = this.$element.find('.modal-dialog') + this.$backdrop = null + this.isShown = null + this.originalBodyPad = null + this.scrollbarWidth = 0 + this.ignoreBackdropClick = false if (this.options.remote) { this.$element @@ -30,7 +33,7 @@ } } - Modal.VERSION = '3.3.2' + Modal.VERSION = '3.3.4' Modal.TRANSITION_DURATION = 300 Modal.BACKDROP_TRANSITION_DURATION = 150 @@ -64,6 +67,12 @@ this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) + this.$dialog.on('mousedown.dismiss.bs.modal', function () { + that.$element.one('mouseup.dismiss.bs.modal', function (e) { + if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true + }) + }) + this.backdrop(function () { var transition = $.support.transition && that.$element.hasClass('fade') @@ -75,7 +84,6 @@ .show() .scrollTop(0) - if (that.options.backdrop) that.adjustBackdrop() that.adjustDialog() if (transition) { @@ -91,7 +99,7 @@ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) transition ? - that.$element.find('.modal-dialog') // wait for modal to slide in + that.$dialog // wait for modal to slide in .one('bsTransitionEnd', function () { that.$element.trigger('focus').trigger(e) }) @@ -120,6 +128,9 @@ .removeClass('in') .attr('aria-hidden', true) .off('click.dismiss.bs.modal') + .off('mouseup.dismiss.bs.modal') + + this.$dialog.off('mousedown.dismiss.bs.modal') $.support.transition && this.$element.hasClass('fade') ? this.$element @@ -180,13 +191,18 @@ var doAnimate = $.support.transition && animate this.$backdrop = $('