mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-02 01:52:53 +00:00
fixed multiple invokes of desendDestroy
This commit is contained in:
parent
b3bbf9f0a9
commit
b751beee19
@ -617,7 +617,7 @@ 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
|
||||||
*/
|
*/
|
||||||
Widget.prototype.removeChildDomNodes = function() {
|
Widget.prototype.removeChildDomNodes = function(noDestroy) {
|
||||||
// If this widget has directly created DOM nodes, delete them and exit. This assumes that any child widgets are contained within the created DOM nodes, which would normally be the case
|
// If this widget has directly created DOM nodes, delete them and exit. This assumes that any child widgets are contained within the created DOM nodes, which would normally be the case
|
||||||
if(this.domNodes.length > 0) {
|
if(this.domNodes.length > 0) {
|
||||||
$tw.utils.each(this.domNodes,function(domNode) {
|
$tw.utils.each(this.domNodes,function(domNode) {
|
||||||
@ -627,10 +627,10 @@ Widget.prototype.removeChildDomNodes = function() {
|
|||||||
} else {
|
} else {
|
||||||
// Otherwise, ask the child widgets to delete their DOM nodes
|
// Otherwise, ask the child widgets to delete their DOM nodes
|
||||||
$tw.utils.each(this.children,function(childWidget) {
|
$tw.utils.each(this.children,function(childWidget) {
|
||||||
childWidget.removeChildDomNodes();
|
childWidget.removeChildDomNodes(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!this.waitDestroy) this.desendDestroy();
|
if (!noDestroy && !this.waitDestroy) this.desendDestroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user