aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorfat <[email protected]>2013-12-29 17:53:59 -0800
committerfat <[email protected]>2013-12-29 17:53:59 -0800
commitce4a2e435268a2eeb5578cbb4ff70bfaaed0eef9 (patch)
treec7afbd31219bb41f5eca75539c430507952aeaab /js
parent5bf13914e49942409c0b21aeaf2ed756c41bd498 (diff)
downloadbootstrap-ce4a2e435268a2eeb5578cbb4ff70bfaaed0eef9.tar.xz
bootstrap-ce4a2e435268a2eeb5578cbb4ff70bfaaed0eef9.zip
fixes #11288 - Vertical scroll position of modal saves between openings
Diffstat (limited to 'js')
-rw-r--r--js/modal.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/js/modal.js b/js/modal.js
index 5fd53b849..856ea7cd8 100644
--- a/js/modal.js
+++ b/js/modal.js
@@ -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