mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
fixes #11288 - Vertical scroll position of modal saves between openings
This commit is contained in:
parent
5bf13914e4
commit
ce4a2e4352
3 changed files with 21 additions and 9 deletions
14
dist/js/bootstrap.js
vendored
14
dist/js/bootstrap.js
vendored
|
@ -787,9 +787,13 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
|
||||||
this.$backdrop =
|
this.$backdrop =
|
||||||
this.isShown = null
|
this.isShown = null
|
||||||
|
|
||||||
if (this.options.remote) this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () {
|
if (this.options.remote) {
|
||||||
this.$element.trigger('loaded.bs.modal')
|
this.$element
|
||||||
}, this))
|
.find('.modal-content')
|
||||||
|
.load(this.options.remote, $.proxy(function () {
|
||||||
|
this.$element.trigger('loaded.bs.modal')
|
||||||
|
}, this))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Modal.DEFAULTS = {
|
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.appendTo(document.body) // don't move modals dom position
|
||||||
}
|
}
|
||||||
|
|
||||||
that.$element.show()
|
that.$element
|
||||||
|
.show()
|
||||||
|
.scrollTop(0)
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
that.$element[0].offsetWidth // force reflow
|
that.$element[0].offsetWidth // force reflow
|
||||||
|
|
2
dist/js/bootstrap.min.js
vendored
2
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
14
js/modal.js
14
js/modal.js
|
@ -18,9 +18,13 @@
|
||||||
this.$backdrop =
|
this.$backdrop =
|
||||||
this.isShown = null
|
this.isShown = null
|
||||||
|
|
||||||
if (this.options.remote) this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () {
|
if (this.options.remote) {
|
||||||
this.$element.trigger('loaded.bs.modal')
|
this.$element
|
||||||
}, this))
|
.find('.modal-content')
|
||||||
|
.load(this.options.remote, $.proxy(function () {
|
||||||
|
this.$element.trigger('loaded.bs.modal')
|
||||||
|
}, this))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Modal.DEFAULTS = {
|
Modal.DEFAULTS = {
|
||||||
|
@ -54,7 +58,9 @@
|
||||||
that.$element.appendTo(document.body) // don't move modals dom position
|
that.$element.appendTo(document.body) // don't move modals dom position
|
||||||
}
|
}
|
||||||
|
|
||||||
that.$element.show()
|
that.$element
|
||||||
|
.show()
|
||||||
|
.scrollTop(0)
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
that.$element[0].offsetWidth // force reflow
|
that.$element[0].offsetWidth // force reflow
|
||||||
|
|
Loading…
Add table
Reference in a new issue