Merge pull request #64 from maxosprojects/bugfix-63-close-tabs-with-middle-mouse-button

fixes #63: Middle mouse button doesn't close tabs
This commit is contained in:
Thomas Brouard 2018-08-07 08:43:31 +02:00 committed by GitHub
commit 8d04115c8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -376,14 +376,14 @@ const TabPrivate = {
}, },
initTabClickHandler: function () { initTabClickHandler: function () {
// Click // Mouse up
const tabClickHandler = function (e) { const tabClickHandler = function (e) {
if (this.isClosed) return; if (this.isClosed) return;
if (e.which === 2) { if (e.which === 2) {
this.close(); this.close();
} }
}; };
this.tab.addEventListener("click", tabClickHandler.bind(this), false); this.tab.addEventListener("mouseup", tabClickHandler.bind(this), false);
// Mouse down // Mouse down
const tabMouseDownHandler = function (e) { const tabMouseDownHandler = function (e) {
if (this.isClosed) return; if (this.isClosed) return;