diff --git a/README.md b/README.md index 24d3a35..3ef3e0d 100644 --- a/README.md +++ b/README.md @@ -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 @@ -182,4 +183,4 @@ var tabGroup = new TabGroup({ ## License -The MIT License (MIT) - Copyright (c) 2016 Thomas Brouard \ No newline at end of file +The MIT License (MIT) - Copyright (c) 2016 Thomas Brouard diff --git a/index.js b/index.js index 6d49ae2..62882b9 100644 --- a/index.js +++ b/index.js @@ -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;