Commit ce4a2e43 authored by fat's avatar fat

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

parent 5bf13914
...@@ -787,10 +787,14 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -787,10 +787,14 @@ 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
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal') this.$element.trigger('loaded.bs.modal')
}, this)) }, this))
} }
}
Modal.DEFAULTS = { Modal.DEFAULTS = {
backdrop: true, backdrop: true,
...@@ -823,7 +827,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -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
......
This diff is collapsed.
...@@ -18,10 +18,14 @@ ...@@ -18,10 +18,14 @@
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
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal') this.$element.trigger('loaded.bs.modal')
}, this)) }, this))
} }
}
Modal.DEFAULTS = { Modal.DEFAULTS = {
backdrop: true, backdrop: true,
...@@ -54,7 +58,9 @@ ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment