mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-05 21:33:52 +00:00
adds depth first destroy
This commit is contained in:
parent
3faadd69c0
commit
b3bbf9f0a9
@ -596,6 +596,24 @@ Widget.prototype.findFirstDomNode = function() {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Depth first destroy
|
||||||
|
*/
|
||||||
|
Widget.prototype.desendDestroy = function() {
|
||||||
|
this.waitDestroy = true; //for blocking repeat calls to this method from removeChildDomNodes
|
||||||
|
$tw.utils.each(this.children,function(childWidget) {
|
||||||
|
childWidget.desendDestroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.destroy) {
|
||||||
|
this.destroy();
|
||||||
|
}
|
||||||
|
this.waitDestroy = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
Widget.prototype.waitDestroy = false;
|
||||||
/*
|
/*
|
||||||
Remove any DOM nodes created by this widget or its children
|
Remove any DOM nodes created by this widget or its children
|
||||||
*/
|
*/
|
||||||
@ -612,6 +630,7 @@ Widget.prototype.removeChildDomNodes = function() {
|
|||||||
childWidget.removeChildDomNodes();
|
childWidget.removeChildDomNodes();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (!this.waitDestroy) this.desendDestroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user