Skip to content

Commit

Permalink
automatic grunt dist
Browse files Browse the repository at this point in the history
  • Loading branch information
twbs-grunt committed Mar 3, 2015
1 parent 200f6fb commit c1005f5
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 29 deletions.
6 changes: 4 additions & 2 deletions dist/css/bootstrap.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/bootstrap.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/bootstrap.min.css

Large diffs are not rendered by default.

54 changes: 31 additions & 23 deletions dist/js/bootstrap.js
Expand Up @@ -916,13 +916,15 @@ if (typeof jQuery === 'undefined') {
// ======================

var Modal = function (element, options) {
this.options = options
this.$body = $(document.body)
this.$element = $(element)
this.$backdrop = null
this.isShown = null
this.originalBodyPad = 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
Expand Down Expand Up @@ -967,6 +969,12 @@ if (typeof jQuery === 'undefined') {

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')

Expand All @@ -978,7 +986,6 @@ if (typeof jQuery === 'undefined') {
.show()
.scrollTop(0)

if (that.options.backdrop) that.adjustBackdrop()
that.adjustDialog()

if (transition) {
Expand All @@ -994,7 +1001,7 @@ if (typeof jQuery === 'undefined') {
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)
})
Expand Down Expand Up @@ -1023,6 +1030,9 @@ if (typeof jQuery === 'undefined') {
.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
Expand Down Expand Up @@ -1083,13 +1093,18 @@ if (typeof jQuery === 'undefined') {
var doAnimate = $.support.transition && animate

this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.prependTo(this.$element)
.on('click.dismiss.bs.modal', $.proxy(function (e) {
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0])
: this.hide.call(this)
}, this))
.appendTo(this.$body)

this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
if (this.ignoreBackdropClick) {
this.ignoreBackdropClick = false
return
}
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus()
: this.hide()
}, this))

if (doAnimate) this.$backdrop[0].offsetWidth // force reflow

Expand Down Expand Up @@ -1124,16 +1139,9 @@ if (typeof jQuery === 'undefined') {
// these following methods are used to handle overflowing modals

Modal.prototype.handleUpdate = function () {
if (this.options.backdrop) this.adjustBackdrop()
this.adjustDialog()
}

Modal.prototype.adjustBackdrop = function () {
this.$backdrop
.css('height', 0)
.css('height', this.$element[0].scrollHeight)
}

Modal.prototype.adjustDialog = function () {
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight

Expand Down
4 changes: 2 additions & 2 deletions dist/js/bootstrap.min.js

Large diffs are not rendered by default.

0 comments on commit c1005f5

Please sign in to comment.