luci-base: form.js: reset parent maps on returning from nested section modal
The nested section modal might have changed values also covered/displayed by the parent map, so ensure to reload all parent maps in the current modal view stack to ensure that no stale values are shown on return. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
818776451d
commit
0c81e25faa
1 changed files with 13 additions and 3 deletions
|
@ -2994,10 +2994,20 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
handleModalCancel: function(modalMap, ev) {
|
handleModalCancel: function(modalMap, ev) {
|
||||||
var prevNode = this.getPreviousModalMap();
|
var prevNode = this.getPreviousModalMap(),
|
||||||
|
resetTasks = Promise.resolve();
|
||||||
|
|
||||||
if (prevNode) {
|
if (prevNode) {
|
||||||
var heading = prevNode.parentNode.querySelector('h4');
|
var heading = prevNode.parentNode.querySelector('h4'),
|
||||||
|
prevMap = dom.findClassInstance(prevNode);
|
||||||
|
|
||||||
|
while (prevMap) {
|
||||||
|
resetTasks = resetTasks
|
||||||
|
.then(L.bind(prevMap.load, prevMap))
|
||||||
|
.then(L.bind(prevMap.reset, prevMap));
|
||||||
|
|
||||||
|
prevMap = prevMap.parent;
|
||||||
|
}
|
||||||
|
|
||||||
prevNode.classList.add('flash');
|
prevNode.classList.add('flash');
|
||||||
prevNode.classList.remove('hidden');
|
prevNode.classList.remove('hidden');
|
||||||
|
@ -3014,7 +3024,7 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p
|
||||||
ui.hideModal();
|
ui.hideModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.resolve();
|
return resetTasks;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
|
|
Loading…
Reference in a new issue