events: use delegated events as much as possible to avoid adding dom listeners when creating widgets
This commit is contained in:
parent
a7683787d2
commit
459a37960c
23 changed files with 172 additions and 113 deletions
|
|
@ -156,7 +156,10 @@ class WidgetManager extends EventEmitter {
|
|||
id = widget.getProp('id')
|
||||
|
||||
if (this.widgets[hash]) {
|
||||
if (this.widgets[hash].onRemove) this.widgets[hash].onRemove()
|
||||
if (this.widgets[hash].onRemove) {
|
||||
this.widgets[hash].onRemove()
|
||||
this.widgets[hash].off()
|
||||
}
|
||||
|
||||
delete this.widgets[hash]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue