]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
Fix #582: Add delay to button
authorDominic Jäger <d.jaeger@proxmox.com>
Mon, 15 Jul 2019 10:28:19 +0000 (12:28 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 25 Jul 2019 11:20:12 +0000 (13:20 +0200)
The StdRemoveButton can now pass a delay parameter to the API.
It is set undefined as default so that users of the button
can set the parameter themselves.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
button/Button.js

index dade477b91f14da311cda0b500b2cbd33b4392ff..266bb8350d6497c59192947cb8f7a75fbdcbb15b 100644 (file)
@@ -104,6 +104,9 @@ Ext.define('Proxmox.button.StdRemoveButton', {
 
     disabled: true,
 
+    // time to wait for removal task to finish
+    delay: undefined,
+
     config: {
        baseurl: undefined
     },
@@ -130,9 +133,11 @@ Ext.define('Proxmox.button.StdRemoveButton', {
 
     handler: function(btn, event, rec) {
        var me = this;
+       var url = me.getUrl(rec);
+       if (typeof me.delay !== 'undefined') url += "?delay=" + me.delay;
 
        Proxmox.Utils.API2Request({
-           url: me.getUrl(rec),
+           url: url,
            method: 'DELETE',
            waitMsgTarget: me.waitMsgTarget,
            callback: function(options, success, response) {