Add: Destroy api #35

This commit is contained in:
surunzi
2017-10-05 19:01:05 +08:00
parent 77d577076e
commit c1550c01d9
11 changed files with 112 additions and 6 deletions

View File

@@ -83,6 +83,13 @@ export default class Elements extends Tool
if (this._origAddEvent) winEventProto.addEventListener = this._origAddEvent;
if (this._origRmEvent) winEventProto.removeEventListener = this._origRmEvent;
}
destroy()
{
super.destroy();
this._select.disable();
this.restoreEventTarget();
}
_back()
{
if (this._curEl === this._htmlEl) return;