]> git.proxmox.com Git - pmg-gui.git/commitdiff
quarantines: mail filter: add clear trigger
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 25 Nov 2022 14:02:25 +0000 (15:02 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 25 Nov 2022 14:25:41 +0000 (15:25 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
js/QuarantineList.js

index 2da02dc190499b269f69e5651aa9768738e4f2f6..5d8ebfa7fdd1f2438e8e3a2cb234f13abf5690bb 100644 (file)
@@ -190,6 +190,7 @@ Ext.define('PMG.QuarantineList', {
            } else {
                me.setUser(value);
            }
+           tb.triggers.clear.setVisible(value.length > 0 && value !== 'all');
            me.load();
        },
 
@@ -362,6 +363,18 @@ Ext.define('PMG.QuarantineList', {
                selectOnFocus: true,
                reference: 'email',
                fieldLabel: 'E-Mail',
+               triggers: {
+                   clear: {
+                       cls: 'pmx-clear-trigger',
+                       weight: -1,
+                       hidden: true,
+                       handler: function() {
+                           this.triggers.clear.setVisible(false);
+                           // 'all' is unfiltered here, so empty/originalValue makes no sense
+                           this.setValue('all');
+                       },
+                   },
+               },
            },
            {
                xtype: 'textfield',