1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-19 11:51:23 +02:00
This commit is contained in:
Heinrich Fenkart
2014-11-05 00:36:52 +01:00
parent 0018723cce
commit 6020bb06f2
14 changed files with 84 additions and 26 deletions

18
dist/js/bootstrap.js vendored
View File

@@ -963,6 +963,7 @@ if (typeof jQuery === 'undefined') {
this.setScrollbar()
this.escape()
if (this.options.backdrop) this.resize()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
@@ -977,6 +978,8 @@ if (typeof jQuery === 'undefined') {
.show()
.scrollTop(0)
if (that.options.backdrop) that.setBackdropHeight()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
@@ -1011,6 +1014,7 @@ if (typeof jQuery === 'undefined') {
this.isShown = false
this.escape()
if (this.options.backdrop) this.resize()
$(document).off('focusin.bs.modal')
@@ -1046,6 +1050,14 @@ if (typeof jQuery === 'undefined') {
}
}
Modal.prototype.resize = function () {
if (this.isShown) {
$(window).on('resize.bs.modal', $.proxy(this.setBackdropHeight, this))
} else {
$(window).off('resize.bs.modal')
}
}
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
@@ -1107,6 +1119,12 @@ if (typeof jQuery === 'undefined') {
}
}
Modal.prototype.setBackdropHeight = function () {
this.$backdrop
.css('height', 0)
.css('height', this.$element[0].scrollHeight)
}
Modal.prototype.checkScrollbar = function () {
this.scrollbarWidth = this.measureScrollbar()
}

File diff suppressed because one or more lines are too long