modal: fix restoring state when recreated
This commit is contained in:
parent
d12716d18f
commit
1175374341
3 changed files with 11 additions and 1 deletions
|
|
@ -1,5 +1,10 @@
|
|||
# Changelog
|
||||
|
||||
## 1.15.2
|
||||
|
||||
- bug fixes
|
||||
- modal: scroll state not restored when the modal container is recreated
|
||||
|
||||
## 1.15.1
|
||||
|
||||
- bug fixes
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ function updateWidget(widget, options={}) {
|
|||
if (stateManager.queueCounter === 0) {
|
||||
for (let id in scrollState) {
|
||||
for (let w of widgetManager.getWidgetById(id)) {
|
||||
if (w.getProp('scroll')) w.setScroll(scrollState[id])
|
||||
if (w.getProp('scroll')) w.setScroll(scrollState[id][0], scrollState[id][1])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,7 +268,12 @@ class Modal extends Panel {
|
|||
|
||||
}
|
||||
|
||||
setScroll(x, y) {
|
||||
|
||||
if (x !== undefined) this.popupContent.firstChild.scrollLeft = this.scroll[0] = x
|
||||
if (y !== undefined) this.popupContent.firstChild.scrollTop = this.scroll[1] = y
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue