Commit ce4a2e43 authored by fat's avatar fat

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

parent 5bf13914
...@@ -787,9 +787,13 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -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" ...@@ -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,9 +18,13 @@ ...@@ -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 @@ ...@@ -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