Is there a way to disable the drawer panel from opening when clicking on a left menu item?

Is there a way to disable the drawer panel from opening when clicking on a left menu item?

1 votes

1 answers

331 views

ANSWER



I sort of figured out how to do this by manually creating the menu button and appending it to outside of the “drawer”

var menuIcon = document.createElement("help-menu-icon");
        menuIcon.setAttribute("icon", "icons:help");
        menuIcon.setAttribute("label", "Help");
        menuIcon.setAttribute("link", "myurl.com");

        var link = document.createElement("a");
        link.setAttribute("href", "https://myurl.com");
        link.setAttribute("target", "_blank");

        menuIcon.appendChild(link);

        var icon = document.createElement("paper-icon-button");
        icon.setAttribute("id","button");
        icon.setAttribute("name","help");
        icon.setAttribute("tabindex", "0");
        icon.setAttribute("aria-disabled", "false")

        link.appendChild(icon);

        var toolTip = document.createElement("nuxeo-tooltip");
        toolTip.setAttribute("for","button");
        toolTip.setAttribute("position","right");
        toolTip.setAttribute("offset","0");
        toolTip.setAttribute("animation-delay","0");
        toolTip.setAttribute("label","Help");

        link.appendChild(toolTip);


        const app = document.querySelector('nuxeo-app');
        app.$.logo.appendChild(menuIcon);
0 votes



Jackie A That's great advice, thanks! Just could you explain where and how to contribute this JS code to the web ui? In the every theme's file nuxeo.war\ui\themes\…\theme.html or maybe there is better solution? Can't find this documented. Thanks!
12/20/2019

I created a custom element and contributed it to the bundle, and this javascript was just read in an observer function - this is a big hack
12/20/2019

Thanks, Jackie A! I was hoping a simpler solution exists. Like putting a .js file in the folder Nuxeo\nxserver\nuxeo.war\scripts.
12/21/2019