Commit 68adf729 authored by Patrick Brunschwig's avatar Patrick Brunschwig

fine-tuning of new appmenu

parent cbf3ddde
Pipeline #66593003 passed with stage
in 4 minutes and 52 seconds
......@@ -429,6 +429,9 @@ Enigmail.msg = {
let menu = document.querySelector("#appMenu-mainView > vbox");
if (!menu) return;
// don't try to add Enigmail menu more than once
if (document.getElementById("appmenu-Enigmail")) return;
let tsk = document.getElementById("appmenu_tasksMenu");
let e = document.createXULElement("toolbarbutton");
e.setAttribute("label", "xxEnigmail");
......@@ -436,6 +439,7 @@ Enigmail.msg = {
e.setAttribute("class", "subviewbutton subviewbutton-nav subviewbutton-iconic");
e.setAttribute("closemenu", "none");
e.setAttribute("oncommand", "Enigmail.msg.displayAppmenu('appMenu-enigmailView', this)");
e.setAttribute("overlay_source", "enigmail");
menu.insertBefore(e, tsk);
},
......@@ -448,6 +452,19 @@ Enigmail.msg = {
displayMainMenu: function(menuPopup) {
let usePep = EnigmailPEPAdapter.usingPep();
let obj = menuPopup.firstChild;
while (obj) {
if (obj.getAttribute("enigmailtype") == "enigmail" || obj.getAttribute("advanced") == "true") {
if (usePep) {
obj.setAttribute("hidden", "true");
} else {
obj.removeAttribute("hidden");
}
}
obj = obj.nextSibling;
}
if (!usePep) {
EnigmailFuncs.collapseAdvanced(menuPopup, 'hidden', Enigmail.msg.updateOptionsDisplay());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment