Drawer - class fix
This commit is contained in:
parent
f79cc037a8
commit
f4c89aed85
@ -176,12 +176,12 @@ public partial class Drawer : UIComponent, IDisposable, INavigationEventReceiver
|
||||
get
|
||||
{
|
||||
return new StyleBuilder()
|
||||
.AddStyle(StyleList);
|
||||
//.AddStyle("width", Width, !string.IsNullOrWhiteSpace(Width) && !Fixed)
|
||||
//.AddStyle("--mud-drawer-width", Width, !string.IsNullOrWhiteSpace(Width) && (!Fixed || Variant == DrawerVariant.Temporary))
|
||||
//.AddStyle("height", Height, !string.IsNullOrWhiteSpace(Height))
|
||||
//.AddStyle("--mud-drawer-content-height",string.IsNullOrWhiteSpace(Height) ? _height.ToPx() : Height,Anchor == Anchor.Bottom || Anchor == Anchor.Top)
|
||||
//.AddStyle("visibility", "hidden", string.IsNullOrWhiteSpace(Height) && _height == 0 && (Anchor == Anchor.Bottom || Anchor == Anchor.Top));
|
||||
.AddStyle(StyleList)
|
||||
.AddStyle("width", Width, !string.IsNullOrWhiteSpace(Width) && !Fixed)
|
||||
.AddStyle("--mud-drawer-width", Width, !string.IsNullOrWhiteSpace(Width) && (!Fixed || Variant == DrawerVariant.Temporary))
|
||||
.AddStyle("height", Height, !string.IsNullOrWhiteSpace(Height))
|
||||
.AddStyle("--mud-drawer-content-height", string.IsNullOrWhiteSpace(Height) ? _height.ToPx() : Height, Anchor == Anchor.Bottom || Anchor == Anchor.Top)
|
||||
.AddStyle("visibility", "hidden", string.IsNullOrWhiteSpace(Height) && _height == 0 && (Anchor == Anchor.Bottom || Anchor == Anchor.Top));
|
||||
|
||||
}
|
||||
}
|
||||
@ -359,6 +359,24 @@ public partial class Drawer : UIComponent, IDisposable, INavigationEventReceiver
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Width of left/right drawer. Only for non-fixed drawers.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string Width { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Width of left/right drawer. Only for non-fixed drawers.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string MiniWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Height of top/bottom temporary drawer
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string Height { get; set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -63,6 +63,22 @@ public partial class DrawerContainer : UIComponent
|
||||
return _drawers.FirstOrDefault(d => d.Variant == DrawerVariant.Mini && (d.Anchor == anchor || d.Anchor == Anchor.Right));
|
||||
}
|
||||
|
||||
private string GetDrawerWidth(Drawer drawer)
|
||||
{
|
||||
if (drawer == null)
|
||||
return string.Empty;
|
||||
|
||||
return drawer.Width;
|
||||
}
|
||||
|
||||
private string GetMiniDrawerWidth(Drawer drawer)
|
||||
{
|
||||
if (drawer == null)
|
||||
return string.Empty;
|
||||
|
||||
return drawer.Width;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Styling properties
|
||||
@ -100,12 +116,11 @@ public partial class DrawerContainer : UIComponent
|
||||
get
|
||||
{
|
||||
return new StyleBuilder()
|
||||
.AddStyle(StyleList);
|
||||
//.AddStyle("width", Width, !string.IsNullOrWhiteSpace(Width) && !Fixed)
|
||||
//.AddStyle("--mud-drawer-width", Width, !string.IsNullOrWhiteSpace(Width) && (!Fixed || Variant == DrawerVariant.Temporary))
|
||||
//.AddStyle("height", Height, !string.IsNullOrWhiteSpace(Height))
|
||||
//.AddStyle("--mud-drawer-content-height",string.IsNullOrWhiteSpace(Height) ? _height.ToPx() : Height,Anchor == Anchor.Bottom || Anchor == Anchor.Top)
|
||||
//.AddStyle("visibility", "hidden", string.IsNullOrWhiteSpace(Height) && _height == 0 && (Anchor == Anchor.Bottom || Anchor == Anchor.Top));
|
||||
.AddStyle(StyleList)
|
||||
.AddStyle("--mud-drawer-width-left", GetDrawerWidth(FindLeftDrawer()), !string.IsNullOrEmpty(GetDrawerWidth(FindLeftDrawer())))
|
||||
.AddStyle("--mud-drawer-width-right", GetDrawerWidth(FindRightDrawer()), !string.IsNullOrEmpty(GetDrawerWidth(FindRightDrawer())))
|
||||
.AddStyle("--mud-drawer-width-mini-left", GetMiniDrawerWidth(FindLeftMiniDrawer()), !string.IsNullOrEmpty(GetMiniDrawerWidth(FindLeftMiniDrawer())))
|
||||
.AddStyle("--mud-drawer-width-mini-right", GetMiniDrawerWidth(FindRightMiniDrawer()), !string.IsNullOrEmpty(GetMiniDrawerWidth(FindRightMiniDrawer())));
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user