Merge pull request #3910 from zyhfish/task/update-pr-3885
remove the visible parameter in module message component.
This commit is contained in:
commit
e2182344a2
|
@ -2,7 +2,7 @@
|
|||
@inherits ModuleControlBase
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@if (Visible && !string.IsNullOrEmpty(Message))
|
||||
@if (!string.IsNullOrEmpty(Message))
|
||||
{
|
||||
<div class="@_classname alert-dismissible fade show mb-3" role="alert">
|
||||
@((MarkupString)Message)
|
||||
|
@ -30,14 +30,10 @@
|
|||
[Parameter]
|
||||
public MessageType Type { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public bool Visible { get; set; } = true;
|
||||
|
||||
public void RefreshMessage(string message, MessageType type, bool visible)
|
||||
public void RefreshMessage(string message, MessageType type)
|
||||
{
|
||||
Message = message;
|
||||
Type = type;
|
||||
Visible = visible;
|
||||
|
||||
UpdateClassName();
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
@if (ModuleType != null)
|
||||
{
|
||||
@((MarkupString)$"<!-- rendermode: {ModuleState.RenderMode} -->")
|
||||
<ModuleMessage @ref="moduleMessageTop" Message="@_messageContent" Type="@_messageType" Visible="@(!string.IsNullOrEmpty(_messageContent) && _messagePosition == "top")" />
|
||||
<ModuleMessage @ref="moduleMessageTop" Message="@_messageContent" Type="@_messageType" />
|
||||
@DynamicComponent
|
||||
@if (_progressIndicator)
|
||||
{
|
||||
<div class="app-progress-indicator"></div>
|
||||
}
|
||||
<ModuleMessage @ref="moduleMessageBottom" Message="@_messageContent" Type="@_messageType" Visible="@(!string.IsNullOrEmpty(_messageContent) && _messagePosition == "bottom")" />
|
||||
<ModuleMessage @ref="moduleMessageBottom" Message="@_messageContent" Type="@_messageType" />
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -131,17 +131,17 @@
|
|||
|
||||
private void Refresh()
|
||||
{
|
||||
var messageTopVisible = !string.IsNullOrEmpty(_messageContent) && _messagePosition == "top";
|
||||
var messageBottomVisible = !string.IsNullOrEmpty(_messageContent) && _messagePosition == "bottom";
|
||||
var updateTop = string.IsNullOrEmpty(_messageContent) || _messagePosition == "top";
|
||||
var updateBottom = string.IsNullOrEmpty(_messageContent) || _messagePosition == "bottom";
|
||||
|
||||
if (moduleMessageTop != null)
|
||||
if (updateTop && moduleMessageTop != null)
|
||||
{
|
||||
moduleMessageTop.RefreshMessage(_messageContent, _messageType, messageTopVisible);
|
||||
moduleMessageTop.RefreshMessage(_messageContent, _messageType);
|
||||
}
|
||||
|
||||
if (moduleMessageBottom != null)
|
||||
if (updateBottom && moduleMessageBottom != null)
|
||||
{
|
||||
moduleMessageBottom.RefreshMessage(_messageContent, _messageType, messageBottomVisible);
|
||||
moduleMessageBottom.RefreshMessage(_messageContent, _messageType);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user