File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 11using  Microsoft . AspNetCore . Components ; 
22using  Microsoft . AspNetCore . Components . Web ; 
3+ using  Microsoft . JSInterop ; 
4+ using  Microsoft . JSInterop . Implementation ; 
35using  System ; 
6+ using  System . Dynamic ; 
47
58namespace  Blazor . AdminLte 
69{ 
710 public  partial  class  NavBarMenuItem  :  INavBarMenuItem 
811 { 
12+  [ Inject ] 
13+  public  Microsoft . JSInterop . IJSRuntime  JS  {  get ;  set ;  } 
914 [ Parameter ] 
1015 public  string  Link  {  get ;  set ;  }  =  "" ; 
1116 [ Parameter ] 
Original file line number Diff line number Diff line change 22@inject  NavigationManager  nav ;
33@implements  IDisposable 
44@inherits  BlazorState .BlazorStateComponent 
5+ @inject  IJSRuntime  JS ;
56<li  class =" nav-item" 
67 <a  href =" @Link" class =" nav-link @(State.GetState(Id).GetDescription<StyleAttribute>())" @onclick =" Click" @onclick:preventDefault >
78 <i  class =" nav-icon @Icon" i >
2425 private  void  Click ()
2526 { 
2627 nav .NavigateTo (Link );
28+  JS .InvokeVoidAsync (" toggleAside" 
2729 } 
2830
2931 protected  override  void  OnInitialized ()
Original file line number Diff line number Diff line change @@ -29,7 +29,11 @@ function deactivateSideMenu() {
2929 $ ( 'aside' ) . find ( "li" ) . each ( function  ( )  {  $ ( this ) . find ( "a" ) . removeClass ( "active" )  } ) ; 
3030} 
3131
32- 
32+ function  toggleAside ( )  { 
33+  $ ( '#sidebar-overlay' ) . click ( ) ; 
34+  //console.log("hi"); 
35+  //$('aside').slideToggle(); 
36+ } 
3337
3438function  addClass ( el ,  _class )  { 
3539 $ ( el ) . addClass ( _class ) ; 
                         You can’t perform that action at this time. 
           
                  
0 commit comments