Page 1 of 1

Overlay Menu not open automatically?

Posted: 27 Apr 2022, 09:25
by rider
Hi,

Is there a possibility that the Overlay Menu on the left side will not open if you redirect to a new page?
So the menu in overlay mode will only open, if the user click on one of the icons from the menu.
I don´t like it that I will navigate from page to page, that the menu will always open.

How can this be changed?

Thanks

Re: Overlay Menu not open automatically?

Posted: 27 Apr 2022, 11:05
by mert.sincan
Hi,

Please change the following method in layout.js

Code: Select all

PrimeFaces.widget.Morpheus = PrimeFaces.widget.BaseWidget.extend({
    ....
   
   restoreTabState: function() {     // Please use this for your issue
        this.expandedTab = $.cookie('morpheus_expandedtab');
        if (this.expandedTab) {
            var tab = $("#" + this.expandedTab.replace(/:/g, "\\:"));
            this.fireTabContentLoadEvent(tab);
            tab.addClass('active-item');
            //this.openMenu(tab.children('a'), true);
        }
        else if(this.cfg.activeIndex) {
            var active = this.tabMenuNavItems.eq(parseInt(this.cfg.activeIndex));
            this.fireTabContentLoadEvent(active);
            active.addClass('active-item');
            //this.openMenu(active.children('a'), true);
        }
    }
}
Best Regards,

Re: Overlay Menu not open automatically?

Posted: 27 Apr 2022, 12:34
by rider
Thanks... It´s working for overlay... but if I have the static it´s not opened...
Static should be as is...

How can this be changed?

Re: Overlay Menu not open automatically?

Posted: 27 Apr 2022, 13:51
by mert.sincan
Please try;

Code: Select all

PrimeFaces.widget.Morpheus = PrimeFaces.widget.BaseWidget.extend({
    ....
   
   restoreTabState: function() {     // Please use this for your issue
        this.expandedTab = $.cookie('morpheus_expandedtab');
        if (this.expandedTab) {
            var tab = $("#" + this.expandedTab.replace(/:/g, "\\:"));
            this.fireTabContentLoadEvent(tab);
            this.isOverlayMenu() ? tab.addClass('active-item') : this.openMenu(tab.children('a'), true);
        }
        else if(this.cfg.activeIndex) {
            var active = this.tabMenuNavItems.eq(parseInt(this.cfg.activeIndex));
            this.fireTabContentLoadEvent(active);
            this.isOverlayMenu() ? active.addClass('active-item') : this.openMenu(active.children('a'), true);
        }
    }
}

Re: Overlay Menu not open automatically?

Posted: 27 Apr 2022, 14:32
by rider
awesome... This is working.

Thank you so much for your quick help

Re: Overlay Menu not open automatically?

Posted: 27 Apr 2022, 20:48
by mert.sincan
Glad to hear, thanks a lot for the update!

Best Regards,