mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-04-21 14:21:30 +00:00
Feat: destroy() method for widgets to do custom cleanup (#6699)
* feat: inform child widget to do some custom cleanup * fix: type * refactor: restore old removeChildDomNodes * refactor: make destroy() a separate method * refactor: make destroy call removeChildDomNodes * refactor: call destroy instead of removeChildDomNodes in each core widgets * fix: refreshSelf does not mean destroy * refactor: use old var insteadof const * docs: about subclass
This commit is contained in:
@@ -62,7 +62,7 @@ CecilyStoryView.prototype.remove = function(widget) {
|
||||
duration = $tw.utils.getAnimationDuration();
|
||||
// Remove the widget at the end of the transition
|
||||
setTimeout(function() {
|
||||
widget.removeChildDomNodes();
|
||||
widget.destroy();
|
||||
},duration);
|
||||
// Animate the closure
|
||||
$tw.utils.setStyle(targetElement,[
|
||||
|
||||
@@ -80,7 +80,7 @@ StackedListView.prototype.insert = function(widget) {
|
||||
};
|
||||
|
||||
StackedListView.prototype.remove = function(widget) {
|
||||
widget.removeChildDomNodes();
|
||||
widget.destroy();
|
||||
};
|
||||
|
||||
exports.stacked = StackedListView;
|
||||
|
||||
Reference in New Issue
Block a user