Skip to content

Commit a522b7d

Browse files
authored
Fix m navigation drawer window event (masastack#165)
* fix(MNavigationDrawer):fix MNavigationDrawer Windows event * refactor code * refactor code
1 parent a66c046 commit a522b7d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Masa.Blazor.Pro/Shared/Navigation.razor

+11-6
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,21 @@
6969
}
7070
}
7171
</MList>
72-
7372
</MNavigationDrawer>
7473

75-
<MButton Small Fab Color="primary" Style="@($"bottom:58px;z-index:7;position: fixed;left:{ButtonLeft}px;")" OnClick=Switch>
76-
<MIcon Class="white--text">
77-
@(GlobalConfig.NavigationMini ? "mdi-chevron-right" : "mdi-chevron-left")
78-
</MIcon>
79-
</MButton>
74+
@if (!(Masa.Breakpoint.Mobile && Visible is true))
75+
{
76+
<MButton Small Fab Color="primary" OnClick=Switch Style="@($"bottom:58px;z-index:7;position: fixed;left:{ButtonLeft}px;")">
77+
<MIcon Class="white--text">
78+
@(Visible is false || GlobalConfig.NavigationMini ? "mdi-chevron-right" : "mdi-chevron-left")
79+
</MIcon>
80+
</MButton>
81+
}
8082

8183
@code {
84+
[Inject]
85+
public MasaBlazor Masa { get; set; } = default!;
86+
8287
public bool Visible { get; set; } = true;
8388

8489
public int ButtonLeft => !Visible ? -14 : GlobalConfig.NavigationMini ? 60 : 280;

0 commit comments

Comments
 (0)