fixes #11288 - Vertical scroll position of modal saves between openings

This commit is contained in:
fat 2013-12-29 17:53:59 -08:00
parent 5bf13914e4
commit ce4a2e4352
3 changed files with 21 additions and 9 deletions

14
dist/js/bootstrap.js vendored
View File

@ -787,9 +787,13 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
this.$backdrop =
this.isShown = null
if (this.options.remote) this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
if (this.options.remote) {
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
}
Modal.DEFAULTS = {
@ -823,7 +827,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
that.$element.appendTo(document.body) // don't move modals dom position
}
that.$element.show()
that.$element
.show()
.scrollTop(0)
if (transition) {
that.$element[0].offsetWidth // force reflow

File diff suppressed because one or more lines are too long

View File

@ -18,9 +18,13 @@
this.$backdrop =
this.isShown = null
if (this.options.remote) this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
if (this.options.remote) {
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
}
Modal.DEFAULTS = {
@ -54,7 +58,9 @@
that.$element.appendTo(document.body) // don't move modals dom position
}
that.$element.show()
that.$element
.show()
.scrollTop(0)
if (transition) {
that.$element[0].offsetWidth // force reflow