1
0
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:
lin onetwo
2023-05-06 19:19:11 +08:00
committed by GitHub
parent 2b95daf59b
commit 474b73bdbe
8 changed files with 37 additions and 14 deletions

View File

@@ -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,[

View File

@@ -80,7 +80,7 @@ StackedListView.prototype.insert = function(widget) {
};
StackedListView.prototype.remove = function(widget) {
widget.removeChildDomNodes();
widget.destroy();
};
exports.stacked = StackedListView;