Added event closing

This commit is contained in:
Robin Riclet 2017-04-04 15:05:24 +02:00
parent a2a5ae7f3c
commit cc838640a5
2 changed files with 6 additions and 4 deletions

View file

@ -148,6 +148,7 @@ The following events are available:
* `tab.on("flash", (tab) => { ... });`
* `tab.on("unflash", (tab) => { ... });`
* `tab.on("close", (tab) => { ... });`
* `tab.on("closing", (tab) => { ... });`
## Drag and drop support

View file

@ -225,6 +225,7 @@ class Tab extends EventEmitter {
}
close (force) {
this.emit("closing", this);
if (this.isClosed || (!this.closable && !force)) return;
this.isClosed = true;
let tabGroup = this.tabGroup;