Switching between Static and Slim menu orientation on side bar toggle

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
kdhorizon
Posts: 12
Joined: 11 Feb 2020, 21:46

23 May 2020, 05:10

Hi,

Hope you are doing good.

I'm using Avalon layout in my angular application. I am trying to change the code in onMenuButtonClick function in app.main.component.ts, to show a slim menu with icons on collapse of side bar and static menu when side bar is expanded. I'm not able to do so.

Could you kindly suggest an optimal way to achieve this?

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

04 Jun 2020, 17:54

kdhorizon wrote:
23 May 2020, 05:10
Hi,

Hope you are doing good.

I'm using Avalon layout in my angular application. I am trying to change the code in onMenuButtonClick function in app.main.component.ts, to show a slim menu with icons on collapse of side bar and static menu when side bar is expanded. I'm not able to do so.

Could you kindly suggest an optimal way to achieve this?
Hi,

Can you try this;

in app.main.component.ts (onMenuButtonClick changed)

Code: Select all

onMenuButtonClick(event) {
        this.menuClick = true;
        this.rotateMenuButton = !this.rotateMenuButton;
        this.topbarMenuActive = false;

        
        if (this.isDesktop()) {
            if (this.layoutMode === MenuOrientation.STATIC){
                this.changeToSlimMenu();
            }
            else {
                this.changeToStaticMenu();
            } 
        } 
        else {
            this.staticMenuMobileActive = !this.staticMenuMobileActive; 
        }

        event.preventDefault();
    }
delete this class from main.scss

Code: Select all

.topbar-right {
                    #menu-button {
                        display: none;
                    }
                }
Regards.

kdhorizon
Posts: 12
Joined: 11 Feb 2020, 21:46

09 Jun 2020, 08:58

Thanks a lot... This works!!

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

02 Aug 2020, 14:33

Thanks @yigitfindikli ;)

Post Reply

Return to “Avalon - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests