widget store pruning fixed
This commit is contained in:
parent
64bad5d8f4
commit
ef26460b9b
1 changed files with 17 additions and 2 deletions
|
|
@ -75,15 +75,30 @@ var updateDom = function(container,data) {
|
|||
}
|
||||
|
||||
|
||||
// restore state
|
||||
// prune widget stores
|
||||
for (i in WIDGETS) {
|
||||
for (j in WIDGETS[i]) {
|
||||
for (var j=WIDGETS[i].length-1;j>=0;j--) {
|
||||
if (!document.contains(WIDGETS[i][j][0])) {
|
||||
WIDGETS[i].splice(j,1)
|
||||
}
|
||||
}
|
||||
if (!WIDGETS[i].length) {
|
||||
delete WIDGETS[i]
|
||||
}
|
||||
}
|
||||
for (i in WIDGETS_LINKED) {
|
||||
for (var j=WIDGETS_LINKED[i].length-1;j>=0;j--) {
|
||||
if (!document.contains(WIDGETS_LINKED[i][j][0])) {
|
||||
WIDGETS_LINKED[i].splice(j,1)
|
||||
}
|
||||
}
|
||||
if (!WIDGETS_LINKED[i].length) {
|
||||
delete WIDGETS_LINKED[i]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// restore state
|
||||
actions.stateSet(state,false)
|
||||
sync()
|
||||
ui.tabs()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue