]> git.proxmox.com Git - pve-manager.git/commitdiff
Overrides Ext.Msg.alert() to always display an Error Icon
authorEmmanuel Kasper <e.kasper@proxmox.com>
Thu, 7 Apr 2016 11:26:23 +0000 (13:26 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 7 Apr 2016 14:52:48 +0000 (16:52 +0200)
www/manager6/Toolkit.js

index 91a4fa64f485ad8579f2c417f9f10edeaa031401..a8089aa85914e51bee7e3777c3d0a822eba2b84b 100644 (file)
@@ -137,6 +137,28 @@ Ext.define('PVE.Datepicker', {
     hideMode: 'visibility'
 });
 
+// force alert boxes to be rendered with an Error Icon
+// since Ext.Msg is an object and not a prototype, we need to override it
+// after the framework has been initiated
+Ext.onReady(function() {
+    Ext.override(Ext.Msg, {
+       alert: function(title, message, fn, scope) {
+           if (Ext.isString(title)) {
+               var config = {
+                   title: title,
+                   message: message,
+                   icon: this.ERROR,
+                   buttons: this.OK,
+                   fn: fn,
+                   scope : scope,
+                   minWidth: this.minWidth
+               };
+           return this.show(config);
+           }
+       }
+    });
+});
+
 Ext.define('Ext.ux.IFrame', {
     extend: 'Ext.Component',