mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-08 11:12:21 +00:00
Fix #582: Add delay to button
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>
This commit is contained in:
parent
1ccb53ecdb
commit
2280ae09a9
@ -104,6 +104,9 @@ Ext.define('Proxmox.button.StdRemoveButton', {
|
|||||||
|
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
|
||||||
|
// time to wait for removal task to finish
|
||||||
|
delay: undefined,
|
||||||
|
|
||||||
config: {
|
config: {
|
||||||
baseurl: undefined
|
baseurl: undefined
|
||||||
},
|
},
|
||||||
@ -130,9 +133,11 @@ Ext.define('Proxmox.button.StdRemoveButton', {
|
|||||||
|
|
||||||
handler: function(btn, event, rec) {
|
handler: function(btn, event, rec) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
var url = me.getUrl(rec);
|
||||||
|
if (typeof me.delay !== 'undefined') url += "?delay=" + me.delay;
|
||||||
|
|
||||||
Proxmox.Utils.API2Request({
|
Proxmox.Utils.API2Request({
|
||||||
url: me.getUrl(rec),
|
url: url,
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
waitMsgTarget: me.waitMsgTarget,
|
waitMsgTarget: me.waitMsgTarget,
|
||||||
callback: function(options, success, response) {
|
callback: function(options, success, response) {
|
||||||
|
Loading…
Reference in New Issue
Block a user