File tree Expand file tree Collapse file tree 7 files changed +40
-18
lines changed
TestApps/BlazorDialog.TestAppsCommon Expand file tree Collapse file tree 7 files changed +40
-18
lines changed Original file line number Diff line number Diff line change 1616 <Copyright />
1717 <PackageTags >blazor blazor-component blazor-dialog dialog modal blazor-modal blazordialog blazormodaldialog blazormodal razor razor-components razorcomponents</PackageTags >
1818 <VersionSuffix >$(VersionSuffix)</VersionSuffix >
19- <Version >1.0 .0</Version >
19+ <Version >1.1 .0</Version >
2020 <Version Condition =" '$(VersionSuffix)' != '' " >$(Version)-$(VersionSuffix)</Version >
2121 <Product >BlazorDialog</Product >
2222 </PropertyGroup >
Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3+ using System . Security . Cryptography . X509Certificates ;
34using System . Text ;
5+ using System . Linq ;
46
57namespace BlazorDialog
68{
@@ -18,6 +20,11 @@ public Dialog GetById(string id)
1820 throw new ArgumentException ( $ "No dialog found for id '{ id } '", nameof ( id ) ) ;
1921 }
2022
23+ public int GetVisibleDialogsCount ( )
24+ {
25+ return registeredDialogs . Count ( x => x . Value . GetVisibility ( ) ) ;
26+ }
27+
2128 public void Register ( Dialog blazorDialog )
2229 {
2330 if ( blazorDialog ? . Id == null )
Original file line number Diff line number Diff line change 88 <CascadingValue Value =" this.Input" Name =" DialogInput" >
99 @if (! IsCustom )
1010 {
11- <div class =" blazor-dialog-container @(Centered ? " blazor-dialog-centered " : " " )" >
11+ <div class =" blazor-dialog-container @(Centered ? " blazor-dialog-centered " : " " )" style = " z-index :@( 1050 + dialogDepth) " >
1212 <div class =" blazor-dialog-content-wrapper @ContentWrapperCssClass @AnimationCssClass" >
1313 <div class =" blazor-dialog-content" >
1414 @ChildContent
152152 }
153153
154154 bool isShowingChanged = false ;
155-
155+ int dialogDepth = 0 ;
156156 protected override async Task OnParametersSetAsync ()
157157 {
158158 if (isShowingChanged && IsShowing == true && ! isShowing )
163163 await OnBeforeShow .InvokeAsync (args );
164164 }
165165 this .isShowing = true ;
166+ dialogDepth = dialogStore .GetVisibleDialogsCount ();
166167 if (OnAfterShow .HasDelegate )
167168 {
168169 var args = new DialogAfterShowEventArgs (this );
225226 await OnBeforeShow .InvokeAsync (args );
226227 }
227228 this .isShowing = true ;
229+ dialogDepth = dialogStore .GetVisibleDialogsCount ();
228230 await InvokeAsync (() => StateHasChanged ());
229231 if (OnAfterShow .HasDelegate )
230232 {
263265 {
264266 await this .Hide <object >(null );
265267 }
268+
269+ public bool GetVisibility ()
270+ {
271+ return this .isShowing ;
272+ }
266273}
Original file line number Diff line number Diff line change @@ -10,5 +10,6 @@ public interface IBlazorDialogStore
1010 void Register ( Dialog blazorDialog ) ;
1111 void Unregister ( Dialog blazorDialog ) ;
1212 Dialog GetById ( string id ) ;
13+ int GetVisibleDialogsCount ( ) ;
1314 }
1415}
Original file line number Diff line number Diff line change 11.blazor-dialog-container {
22 position : fixed;
3- z-index : 1050 ;
43 left : 0 ;
54 top : 0 ;
65 width : 100% ; /* Full width */
Original file line number Diff line number Diff line change @@ -76,7 +76,12 @@ Make sure that there is a call to `app.UseStaticFiles();` in your server project
7676
7777## Release Notes
7878
79- <details open =" open " ><summary >1.0</summary >
79+ <details open =" open " ><summary >1.1</summary >
80+
81+ > - Added support for dialog-in-dialog.
82+ </details>
83+
84+ <details ><summary >1.0</summary >
8085
8186> - Fixed an infinite loop bug with ` OnBeforeShow ` event.
8287> - Fixed css bugs.
Original file line number Diff line number Diff line change 2020 <option value =" @DialogAnimation.Zoom" >@DialogAnimation.Zoom </option >
2121 <option value =" @DialogAnimation.FadeIn" >@DialogAnimation.FadeIn </option >
2222</select >
23-
24- <Dialog Id =" simple-dialog" Size =" size" Centered =" isCentered" Animation =" animation" >
25- <DialogInputProvider TInput =" string" >
26- <DialogBody >
27- <h4 >@context.Input </h4 >
28- </DialogBody >
29- <DialogFooter >
30- <button type =" button" class =" btn btn-primary" @onclick =" @(() => context.Dialog.Hide(" yes " ))" >Yes</button >
31- <button type =" button" class =" btn btn-secondary" @onclick =" @(()=> context.Dialog.Hide(" no " ))" >No</button >
32- </DialogFooter >
33- </DialogInputProvider >
34- </Dialog >
35-
3623<Dialog Id =" simple-large-dialog" Size =" size" Centered =" isCentered" Animation =" animation" >
3724 <DialogInputProvider TInput =" string" >
3825 <DialogHeader ShowClose =" true" >
6047 </DialogInputProvider >
6148</Dialog >
6249
50+ <Dialog Id =" simple-dialog" Size =" size" Centered =" isCentered" Animation =" animation" >
51+ <DialogInputProvider TInput =" string" >
52+ <DialogBody >
53+ <h4 >@context.Input </h4 >
54+ </DialogBody >
55+ <DialogFooter >
56+ <button type =" button" class =" btn btn-primary" @onclick =" @(() => context.Dialog.Hide(" yes " ))" >Yes</button >
57+ <button type =" button" class =" btn btn-secondary" @onclick =" @(()=> context.Dialog.Hide(" no " ))" >No</button >
58+
59+ <button @onclick =" SimpleDialogBigOnClick" >Simple Dialog Big (dialog in dialog)</button >
60+ </DialogFooter >
61+ </DialogInputProvider >
62+ </Dialog >
63+
64+
65+
6366<button @onclick =" SimpleDialogOnClick" >Simple Dialog</button >
6467<button @onclick =" SimpleDialogBigOnClick" >Simple Dialog Big</button >
6568
You can’t perform that action at this time.
0 commit comments