]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
task type selector: add clear trigger
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 3 Nov 2020 12:58:12 +0000 (13:58 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 3 Nov 2020 13:41:43 +0000 (14:41 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/form/TaskTypeSelector.js

index b370cb4872079e33c8e5e6e027f6b1a1142b7a92..faf48a9650b44e7e108590685645ca707b2520d6 100644 (file)
@@ -9,4 +9,22 @@ Ext.define('Proxmox.form.TaskTypeSelector', {
        me.store = Object.keys(Proxmox.Utils.task_desc_table).sort();
        me.callParent();
     },
+    listeners: {
+       change: function(field, newValue, oldValue) {
+           if (newValue !== this.originalValue) {
+               this.triggers.clear.setVisible(true);
+           }
+       },
+    },
+    triggers: {
+       clear: {
+           cls: 'pmx-clear-trigger',
+           weight: -1,
+           hidden: true,
+           handler: function() {
+               this.triggers.clear.setVisible(false);
+               this.setValue(this.originalValue);
+           },
+       },
+    },
 });