Change default open menu

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
dionatan1989
Posts: 2
Joined: 02 Jun 2013, 17:21

04 Mar 2017, 22:46

How to make sidebar stay closed by default?

dionatan1989
Posts: 2
Joined: 02 Jun 2013, 17:21

05 Mar 2017, 06:27

I notice that menu state saving is not working when I close de menu. When I refresh the page, menu open again.

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

07 Mar 2017, 12:10

I think you can use stateful="false" attribute on tabMenu component. Or you can override openMenu method;

Code: Select all

PrimeFaces.widget.Morpheus.prototype.openMenu = function(link, restore) {
        this.sidebar.css('overflow','hidden');
        var parent = link.parent();
        parent.addClass('active-item');

        if(restore) {
            this.wrapper.addClass('layout-wrapper-menu-active-restore');
        }
        else {
            this.wrapper.addClass('layout-wrapper-menu-active');
        }
        
        this.tabMenu.find('.layout-tabmenu-content').removeClass('layout-tabmenu-content-active').
                eq(parent.index()).addClass('layout-tabmenu-content-active');
        
        if(this.cfg.stateful) {
            this.saveTabState(parent.attr('id'));
        }
};

Post Reply

Return to “Morpheus - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests