File tree Expand file tree Collapse file tree 2 files changed +1
-17
lines changed
src/BootstrapBlazor/Components/Message Expand file tree Collapse file tree 2 files changed +1
-17
lines changed Original file line number Diff line number Diff line change 55<div id =" @Id" class =" @ClassString" style =" @StyleName " role =" alert" >
66 @foreach ( var item in GetMessages ())
77 {
8- <div @key =" item" id =" @GetItemId(item)" role =" alertdialog" class =" @GetItemClassString(item)" data-bb-autohide =" @GetAutoHideString(item)" data-bb-delay =" @GetDelayString( item) " >
8+ <div @key =" item" id =" @GetItemId(item)" role =" alertdialog" class =" @GetItemClassString(item)" data-bb-autohide =" @GetAutoHideString(item)" data-bb-delay =" @item.Delay " >
99 @if (! string .IsNullOrEmpty (item .Icon ))
1010 {
1111 <i class =" @item.Icon" ></i >
Original file line number Diff line number Diff line change 33// See the LICENSE file in the project root for more information.
44// Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone 55
6- using System . Globalization ;
7-
86namespace BootstrapBlazor . Components ;
97
108/// <summary>
@@ -42,10 +40,6 @@ public partial class Message
4240 [ NotNull ]
4341 public MessageService ? MessageService { get ; set ; }
4442
45- [ Inject ]
46- [ NotNull ]
47- private IOptionsMonitor < BootstrapBlazorOptions > ? Options { get ; set ; }
48-
4943 /// <summary>
5044 /// <inheritdoc/>
5145 /// </summary>
@@ -72,16 +66,6 @@ protected override void OnInitialized()
7266 . AddClass ( "alert-bar" , option . ShowBar )
7367 . Build ( ) ;
7468
75- private string GetDelayString ( MessageOption option ) => GetDelay ( option ) . ToString ( CultureInfo . InvariantCulture ) ;
76-
77- private int GetDelay ( MessageOption option ) => option . ForceDelay
78- ? option . Delay
79- : GetOptionsDelay ( option ) ;
80-
81- private int GetOptionsDelay ( MessageOption option ) => Options . CurrentValue . MessageDelay == 0
82- ? option . Delay
83- : Options . CurrentValue . MessageDelay ;
84-
8569 private string GetItemId ( MessageOption option ) => $ "{ Id } _{ option . GetHashCode ( ) } ";
8670
8771 private string ? _msgId ;
You can’t perform that action at this time.
0 commit comments