]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
reintroduce api2request checks for toolkit
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 15 Jan 2018 13:51:24 +0000 (14:51 +0100)
committerDominik Csapak <d.csapak@proxmox.com>
Mon, 15 Jan 2018 13:51:24 +0000 (14:51 +0100)
Utils.js

index ac243ce6f3c0eef782c5184038361b7c2d044125..a8d7b6f70c81fc1ea2155c2012a93b2a4bc0729b 100644 (file)
--- a/Utils.js
+++ b/Utils.js
@@ -283,7 +283,11 @@ Ext.define('Proxmox.Utils', { utilities: {
            Ext.apply(newopts, {
                success: function(response, options) {
                    if (options.waitMsgTarget) {
-                       options.waitMsgTarget.setLoading(false);
+                       if (Proxmox.Utils.toolkit === 'touch') {
+                           options.waitMsgTarget.setMasked(false);
+                       } else {
+                           options.waitMsgTarget.setLoading(false);
+                       }
                    }
                    var result = Ext.decode(response.responseText);
                    response.result = result;
@@ -298,7 +302,11 @@ Ext.define('Proxmox.Utils', { utilities: {
                },
                failure: function(response, options) {
                    if (options.waitMsgTarget) {
-                       options.waitMsgTarget.setLoading(false);
+                       if (Proxmox.Utils.toolkit === 'touch') {
+                           options.waitMsgTarget.setMasked(false);
+                       } else {
+                           options.waitMsgTarget.setLoading(false);
+                       }
                    }
                    response.result = {};
                    try {
@@ -323,8 +331,12 @@ Ext.define('Proxmox.Utils', { utilities: {
 
        var target = newopts.waitMsgTarget;
        if (target) {
-           // Note: ExtJS bug - this does not work when component is not rendered
-           target.setLoading(newopts.waitMsg);
+           if (Proxmox.Utils.toolkit === 'touch') {
+               target.setMasked({ xtype: 'loadmask', message: newopts.waitMsg} );
+           } else {
+               // Note: ExtJS bug - this does not work when component is not rendered
+               target.setLoading(newopts.waitMsg);
+           }
        }
        Ext.Ajax.request(newopts);
     },