Open Closed

How to close usermenu? #10804


0
rvanwoezik created

ASP.NET CORE & Angular (single solution) .NET 5.0 v10.2.0

I have added a navigation option to user-menu.component.html <a routerLink="/app/admin/subscription-management" class="navi-item" id="ShowMySubscriptionsLink"> <div class="navi-link"> <div class="symbol symbol-40 bg-light mr-3"> <div class="symbol-label pulse pulse-primary"> <span class="svg-icon svg-icon-primary svg-icon-2x svg-icon-primary"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <rect x="0" y="0" width="24" height="24"></rect> <path d="M2.56066017,10.6819805 L4.68198052,8.56066017 C5.26776695,7.97487373 6.21751442,7.97487373 6.80330086,8.56066017 L8.9246212,10.6819805 C9.51040764,11.267767 9.51040764,12.2175144 8.9246212,12.8033009 L6.80330086,14.9246212 C6.21751442,15.5104076 5.26776695,15.5104076 4.68198052,14.9246212 L2.56066017,12.8033009 C1.97487373,12.2175144 1.97487373,11.267767 2.56066017,10.6819805 Z M14.5606602,10.6819805 L16.6819805,8.56066017 C17.267767,7.97487373 18.2175144,7.97487373 18.8033009,8.56066017 L20.9246212,10.6819805 C21.5104076,11.267767 21.5104076,12.2175144 20.9246212,12.8033009 L18.8033009,14.9246212 C18.2175144,15.5104076 17.267767,15.5104076 16.6819805,14.9246212 L14.5606602,12.8033009 C13.9748737,12.2175144 13.9748737,11.267767 14.5606602,10.6819805 Z" fill="#000000" opacity="0.3"></path> <path d="M8.56066017,16.6819805 L10.6819805,14.5606602 C11.267767,13.9748737 12.2175144,13.9748737 12.8033009,14.5606602 L14.9246212,16.6819805 C15.5104076,17.267767 15.5104076,18.2175144 14.9246212,18.8033009 L12.8033009,20.9246212 C12.2175144,21.5104076 11.267767,21.5104076 10.6819805,20.9246212 L8.56066017,18.8033009 C7.97487373,18.2175144 7.97487373,17.267767 8.56066017,16.6819805 Z M8.56066017,4.68198052 L10.6819805,2.56066017 C11.267767,1.97487373 12.2175144,1.97487373 12.8033009,2.56066017 L14.9246212,4.68198052 C15.5104076,5.26776695 15.5104076,6.21751442 14.9246212,6.80330086 L12.8033009,8.9246212 C12.2175144,9.51040764 11.267767,9.51040764 10.6819805,8.9246212 L8.56066017,6.80330086 C7.97487373,6.21751442 7.97487373,5.26776695 8.56066017,4.68198052 Z" fill="#000000"></path> </g> </svg> </span> <span class="pulse-ring"></span> </div> </div> <div class="navi-text"> <div class="font-weight-bold"> {{"MySubscription" | localize}} </div> <div class="text-muted"> {{"MySubscription_Description" | localize}} </div> </div> </div> </a> From where i navigate to the subscription page, (i have all users on a seperate tenant)

How do i close/toggle the usermenu after navigation?

Thanks in advance! Rene


4 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @rvanwoezik

    The menu items are expanded when they have "show" css class. You can modify this line https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/app/shared/layout/nav/side-bar-menu.component.ts#L149 to change that behavior.

  • 0
    rvanwoezik created

    Hi @ismcagdag, sorry i wasn't clear, i mean the usermenu in your profile

    So after clicking My Subscriptions <a routerLink="/app/admin/subscription-management" i want to hide the usermenu

  • 0
    ismcagdas created
    Support Team

    Hi,

    Thanks :).

    In that way, you can follow a similar approach to "Login Attempts" item like below;

    <a href="javascript:;" (click)="showLoginAttempts()" class="menu-link px-5" id="ShowLoginAttemptsLink">
    
    showLoginAttempts(): void {
        this._router.navigate(['/app/admin/login-attempts']);
    }
    
  • 0
    rvanwoezik created

    Found it! was still using version 10 above mentioned showLoginAttempts was different in version 10 thanks