Overlay Menu not open automatically?

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
rider
Posts: 497
Joined: 05 Mar 2010, 13:17

27 Apr 2022, 09:25

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
Primefaces 12.0, WildFly 21

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

27 Apr 2022, 11:05

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,

rider
Posts: 497
Joined: 05 Mar 2010, 13:17

27 Apr 2022, 12:34

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?
Primefaces 12.0, WildFly 21

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

27 Apr 2022, 13:51

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);
        }
    }
}

rider
Posts: 497
Joined: 05 Mar 2010, 13:17

27 Apr 2022, 14:32

awesome... This is working.

Thank you so much for your quick help
Primefaces 12.0, WildFly 21

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

27 Apr 2022, 20:48

Glad to hear, thanks a lot for the update!

Best Regards,

Post Reply

Return to “Morpheus - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests