diff --git a/MP.INVE/Pages/_Layout.cshtml b/MP.INVE/Pages/_Layout.cshtml index f7a5c3fa..967701ec 100644 --- a/MP.INVE/Pages/_Layout.cshtml +++ b/MP.INVE/Pages/_Layout.cshtml @@ -62,5 +62,6 @@ + diff --git a/MP.INVE/Shared/MainLayout.razor b/MP.INVE/Shared/MainLayout.razor index 75da5b44..d7ff713a 100644 --- a/MP.INVE/Shared/MainLayout.razor +++ b/MP.INVE/Shared/MainLayout.razor @@ -6,12 +6,18 @@
- + @if ((Height != 480) && (Width != 320)) + { + + }
- + @if ((Height != 480) && (Width != 320)) + { + + }
@if (userName != "0" || NavManager.Uri.Contains("OperatoreLogin")) diff --git a/MP.INVE/Shared/MainLayout.razor.cs b/MP.INVE/Shared/MainLayout.razor.cs index 089b4dfa..f72febb2 100644 --- a/MP.INVE/Shared/MainLayout.razor.cs +++ b/MP.INVE/Shared/MainLayout.razor.cs @@ -1,5 +1,6 @@ using Blazored.LocalStorage; using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; using MP.Data.DTO; namespace MP.INVE.Shared @@ -44,9 +45,21 @@ namespace MP.INVE.Shared } } + public int Height { get; set; } + public int Width { get; set; } + + public class WindowDimension + { + public int Width { get; set; } + public int Height { get; set; } + } + protected override async Task OnInitializedAsync() { await getId(); + var dimension = await JSRuntime.InvokeAsync("getWindowDimensions"); + Height = dimension.Height; + Width = dimension.Width; } protected void UpdateNavDisplay() @@ -65,6 +78,9 @@ namespace MP.INVE.Shared [Inject] private NavigationManager NavManager { get; set; } = null!; + [Inject] + private IJSRuntime JSRuntime { get; set; } = null!; + #endregion Private Properties } } \ No newline at end of file diff --git a/MP.INVE/Shared/NavMenu.razor b/MP.INVE/Shared/NavMenu.razor index a44fbbcd..cd920e0e 100644 --- a/MP.INVE/Shared/NavMenu.razor +++ b/MP.INVE/Shared/NavMenu.razor @@ -52,7 +52,7 @@
- *@