mirror of
https://ark.sudovanilla.org/Korbs/electron-tabs.git
synced 2024-12-23 03:53:53 +00:00
Fixed force when calling tab.close()
This commit is contained in:
parent
a2a5ae7f3c
commit
58258cbc65
10
index.js
10
index.js
|
@ -268,7 +268,7 @@ const TabPrivate = {
|
||||||
let button = container.appendChild(document.createElement("button"));
|
let button = container.appendChild(document.createElement("button"));
|
||||||
button.classList.add(`${tabClass}-button-close`);
|
button.classList.add(`${tabClass}-button-close`);
|
||||||
button.innerHTML = this.tabGroup.options.closeButtonText;
|
button.innerHTML = this.tabGroup.options.closeButtonText;
|
||||||
button.addEventListener("click", this.close.bind(this), false);
|
button.addEventListener("click", this.close.bind(this, false), false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -294,13 +294,13 @@ const TabPrivate = {
|
||||||
|
|
||||||
initWebview: function () {
|
initWebview: function () {
|
||||||
this.webview = document.createElement("webview");
|
this.webview = document.createElement("webview");
|
||||||
|
|
||||||
const tabWebviewDidFinishLoadHandler = function (e) {
|
const tabWebviewDidFinishLoadHandler = function (e) {
|
||||||
this.emit("webview-ready", this);
|
this.emit("webview-ready", this);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.webview.addEventListener("did-finish-load", tabWebviewDidFinishLoadHandler.bind(this), false);
|
this.webview.addEventListener("did-finish-load", tabWebviewDidFinishLoadHandler.bind(this), false);
|
||||||
|
|
||||||
this.webview.classList.add(this.tabGroup.options.viewClass);
|
this.webview.classList.add(this.tabGroup.options.viewClass);
|
||||||
if (this.webviewAttributes) {
|
if (this.webviewAttributes) {
|
||||||
let attrs = this.webviewAttributes;
|
let attrs = this.webviewAttributes;
|
||||||
|
@ -308,9 +308,9 @@ const TabPrivate = {
|
||||||
this.webview.setAttribute(key, attrs[key]);
|
this.webview.setAttribute(key, attrs[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tabGroup.viewContainer.appendChild(this.webview);
|
this.tabGroup.viewContainer.appendChild(this.webview);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = TabGroup;
|
module.exports = TabGroup;
|
||||||
|
|
Loading…
Reference in a new issue