2222 <div class =" modal-footer" >
2323 @if (! string .IsNullOrEmpty (Action ))
2424 {
25- <button type =" button" class =" @Class " @onclick =" Confirm" >@( (MarkupString )_iconSpan ) @Text </button >
25+ <button type =" button" class =" @ConfirmClass " @onclick =" Confirm" >@( (MarkupString )_iconSpan ) @Text </button >
2626 }
27- <button type =" button" class =" btn btn-secondary " @onclick =" DisplayModal" >@SharedLocalizer ["Cancel "]</button >
27+ <button type =" button" class =" @CancelClass " @onclick =" DisplayModal" >@SharedLocalizer ["Cancel "]</button >
2828 </div >
2929 </div >
3030 </div >
6666 {
6767 <form method =" post" @formname =" @($" ActionDialogConfirmForm:{ModuleState.PageModuleId}:{Id} " )" @onsubmit =" Confirm" data-enhance >
6868 <input type =" hidden" name =" @Constants.RequestVerificationToken" value =" @SiteState.AntiForgeryToken" />
69- <button type =" submit" class =" @Class " >@( (MarkupString )_iconSpan ) @Text </button >
69+ <button type =" submit" class =" @ConfirmClass " >@( (MarkupString )_iconSpan ) @Text </button >
7070 </form >
7171 }
7272 <form method =" post" @formname =" @($" ActionDialogCancelForm:{ModuleState.PageModuleId}:{Id} " )" @onsubmit =" DisplayModal" data-enhance >
7373 <input type =" hidden" name =" @Constants.RequestVerificationToken" value =" @SiteState.AntiForgeryToken" />
74- <button type =" submit" class =" btn btn-secondary " >@SharedLocalizer ["Cancel "]</button >
74+ <button type =" submit" class =" @CancelClass " >@SharedLocalizer ["Cancel "]</button >
7575 </form >
7676 </div >
7777 </div >
@@ -128,6 +128,12 @@ else
128128 [Parameter ]
129129 public string Class { get ; set ; } // optional
130130
131+ [Parameter ]
132+ public string ConfirmClass { get ; set ; } // optional - for Confirm modal button
133+
134+ [Parameter ]
135+ public string CancelClass { get ; set ; } // optional - for Cancel modal button
136+
131137 [Parameter ]
132138 public bool Disabled { get ; set ; } // optional
133139
@@ -168,6 +174,16 @@ else
168174 Class = " btn btn-success" ;
169175 }
170176
177+ if (string .IsNullOrEmpty (ConfirmClass ))
178+ {
179+ ConfirmClass = Class ;
180+ }
181+
182+ if (string .IsNullOrEmpty (CancelClass ))
183+ {
184+ CancelClass = " btn btn-secondary" ;
185+ }
186+
171187 if (! string .IsNullOrEmpty (EditMode ))
172188 {
173189 _editmode = bool .Parse (EditMode );
196212 _openIconSpan = $" <span class=\" {IconName }\" ></span>{(IconOnly ? " " : "  " )}" ;
197213 _iconSpan = $" <span class=\" {IconName }\" ></span> " ;
198214 }
199-
215+
200216 _permissions = (PermissionList == null ) ? ModuleState .PermissionList : PermissionList ;
201217 _authorized = IsAuthorized ();
202218
@@ -207,6 +223,15 @@ else
207223 _visible = (PageState .QueryString [" dialog" ] == Id );
208224 }
209225 }
226+ /// <summary >
227+ /// Checks the Class that is used for the Action Button, if it is small make the Cancel Button small as well.
228+ /// </summary >
229+ /// <param name =" Class" ></param >
230+ /// <returns ></returns >
231+ private string GetButtonSize ()
232+ {
233+ return Class .Contains (" btn-sm" , StringComparison .OrdinalIgnoreCase ) ? " btn-sm" : string .Empty ;
234+ }
210235
211236 private bool IsAuthorized ()
212237 {
0 commit comments