mirror of
https://ark.sudovanilla.org/Korbs/electron-tabs.git
synced 2025-01-08 20:03:57 +00:00
Activate on mousedown (dragula compatibility)
This commit is contained in:
parent
d4e6d471b2
commit
6428039463
13
index.js
13
index.js
|
@ -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 () {
|
||||||
|
|
Loading…
Reference in a new issue