Activate on mousedown (dragula compatibility)

This commit is contained in:
Thomas Brouard 2016-11-02 17:56:16 +01:00
parent d4e6d471b2
commit 6428039463

View file

@ -266,15 +266,22 @@ const TabPrivate = {
}, },
initTabClickHandler: function () { initTabClickHandler: function () {
// Click
const tabClickHandler = function (e) { const tabClickHandler = function (e) {
if (this.isClosed) return; if (this.isClosed) return;
if (e.which === 1) { if (e.which === 2) {
this.activate();
} else if (e.which === 2) {
this.close(); this.close();
} }
}; };
this.tab.addEventListener("click", tabClickHandler.bind(this), false); this.tab.addEventListener("click", tabClickHandler.bind(this), false);
// Mouse down
const tabMouseDownHandler = function (e) {
if (this.isClosed) return;
if (e.which === 1) {
this.activate();
}
};
this.tab.addEventListener("mousedown", tabMouseDownHandler.bind(this), false);
}, },
initWebview: function () { initWebview: function () {