File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed
Abp.Web.Mvc/Web/Mvc/Controllers
Abp.Web.Resources/Abp/Framework/scripts/libs Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,20 @@ public async Task<ActionResult> GetScripts()
67
67
68
68
sb . AppendLine ( await _settingScriptManager . GetScriptAsync ( ) ) ;
69
69
70
+ sb . AppendLine ( GetTriggerScript ( ) ) ;
71
+
70
72
return Content ( sb . ToString ( ) , "application/x-javascript" , Encoding . UTF8 ) ;
71
73
}
74
+
75
+ private string GetTriggerScript ( )
76
+ {
77
+ var script = new StringBuilder ( ) ;
78
+
79
+ script . AppendLine ( "(function(){" ) ;
80
+ script . AppendLine ( " abp.event.trigger('abp.dynamicScriptsInitialized');" ) ;
81
+ script . Append ( "})();" ) ;
82
+
83
+ return script . ToString ( ) ;
84
+ }
72
85
}
73
86
}
Original file line number Diff line number Diff line change 26
26
} ,
27
27
confirm : {
28
28
type : 'warning' ,
29
- title : abp . localization . abpWeb ( 'AreYouSure' ) ,
29
+ title : 'Are you sure?' ,
30
30
showCancelButton : true ,
31
- cancelButtonText : abp . localization . abpWeb ( 'Cancel' ) ,
31
+ cancelButtonText : 'Cancel' ,
32
32
confirmButtonColor : "#DD6B55" ,
33
- confirmButtonText : abp . localization . abpWeb ( 'Yes' )
33
+ confirmButtonText : 'Yes'
34
34
}
35
35
}
36
36
} ;
54
54
) ;
55
55
56
56
return $ . Deferred ( function ( $dfd ) {
57
- sweetAlert ( opts , function ( value ) {
58
- $dfd . resolve ( value ) ;
57
+ sweetAlert ( opts , function ( ) {
58
+ $dfd . resolve ( ) ;
59
59
} ) ;
60
60
} ) ;
61
61
} ;
97
97
return $ . Deferred ( function ( $dfd ) {
98
98
sweetAlert ( opts , function ( isConfirmed ) {
99
99
callback && callback ( isConfirmed ) ;
100
- $dfd . resolve ( isConfirmed ) ;
100
+ $dfd . resolve ( ) ;
101
101
} ) ;
102
102
} ) ;
103
103
} ;
104
104
105
+ abp . event . on ( 'abp.dynamicScriptsInitialized' , function ( ) {
106
+ abp . libs . sweetAlert . config . confirm . title = abp . localization . abpWeb ( 'AreYouSure' ) ;
107
+ abp . libs . sweetAlert . config . confirm . cancelButtonText = abp . localization . abpWeb ( 'Cancel' ) ;
108
+ abp . libs . sweetAlert . config . confirm . confirmButtonText = abp . localization . abpWeb ( 'Yes' ) ;
109
+ } ) ;
110
+
105
111
} ) ( jQuery ) ;
You can’t perform that action at this time.
0 commit comments