mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 09:49:58 +02:00
Added "open split view in new tab" context menu button
This commit is contained in:
parent
fbf63e4bc1
commit
dcea272d88
1 changed files with 14 additions and 2 deletions
|
@ -10,6 +10,19 @@ var gZenViewSplitter = new class {
|
||||||
window.addEventListener("TabClose", this.handleTabClose.bind(this));
|
window.addEventListener("TabClose", this.handleTabClose.bind(this));
|
||||||
this.initializeContextMenu();
|
this.initializeContextMenu();
|
||||||
this.insertPageActionButton();
|
this.insertPageActionButton();
|
||||||
|
this.insertIntoContextMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
insertIntoContextMenu() {
|
||||||
|
const sibling = document.getElementById("context-stripOnShareLink");
|
||||||
|
const menuitem = document.createXULElement("menuitem");
|
||||||
|
menuitem.setAttribute("id", "context-zenSplitLink");
|
||||||
|
menuitem.setAttribute("hidden", "true");
|
||||||
|
menuitem.setAttribute("oncommand", "gZenViewSplitter.splitLinkInNewTab();");
|
||||||
|
menuitem.setAttribute("data-l10n-id", "zen-split-link");
|
||||||
|
sibling.insertAdjacentElement("afterend", document.createXULElement("menuseparator"));
|
||||||
|
sibling.insertAdjacentElement("afterend", menuitem);
|
||||||
|
sibling.insertAdjacentElement("afterend", document.createXULElement("menuseparator"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -567,8 +580,7 @@ var gZenViewSplitter = new class {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.currentView >= 0) {
|
if (this.currentView >= 0) {
|
||||||
this._data[this.currentView].gridType = gridType;
|
return;
|
||||||
this.updateSplitView(window.gBrowser.selectedTab);
|
|
||||||
}
|
}
|
||||||
const tabs = gBrowser.tabs;
|
const tabs = gBrowser.tabs;
|
||||||
if (tabs.length < 2) {
|
if (tabs.length < 2) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue