]> git.proxmox.com Git - pmg-gui.git/commitdiff
quarantine: contextmenu: refactor for use in other quarantines
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 20 Oct 2022 19:14:58 +0000 (21:14 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 21 Oct 2022 07:28:21 +0000 (09:28 +0200)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
js/Makefile
js/QuarantineContextMenu.js [new file with mode: 0644]
js/SpamContextMenu.js

index 0b9f93b8d57544b16eff10b70994d5cb24991335..b904598dde9825cc719b1f1080b97e54c005dc0e 100644 (file)
@@ -19,6 +19,7 @@ JSSRC=                                                        \
        RuleInfo.js                                     \
        RuleEditor.js                                   \
        MainView.js                                     \
+       QuarantineContextMenu.js                        \
        QuarantineList.js                               \
        SpamInfoGrid.js                                 \
        MailInfo.js                                     \
diff --git a/js/QuarantineContextMenu.js b/js/QuarantineContextMenu.js
new file mode 100644 (file)
index 0000000..4f7744e
--- /dev/null
@@ -0,0 +1,32 @@
+Ext.define('PMG.menu.QuarantineContextMenu', {
+    extend: 'Ext.menu.Menu',
+    xtype: 'pmgQuarantineMenu',
+
+    showSeparator: false,
+
+    controller: {
+       xclass: 'Ext.app.ViewController',
+       callCallback: function(btn) {
+           let view = this.getView();
+           if (Ext.isFunction(view.callback)) {
+               view.callback(btn.action);
+           }
+       },
+    },
+
+    items: [
+       {
+           text: gettext('Deliver'),
+           iconCls: 'fa fa-fw fa-paper-plane-o',
+           action: 'deliver',
+           handler: 'callCallback',
+       },
+       {
+           text: gettext('Delete'),
+           iconCls: 'fa fa-fw fa-trash-o',
+           action: 'delete',
+           handler: 'callCallback',
+       },
+    ],
+});
+
index 5fb4816d032bae53230234a561e4261bde1a640c..b089f0f27f9a71049376e63e76c07d4de696e000 100644 (file)
@@ -1,17 +1,5 @@
 Ext.define('PMG.menu.SpamContextMenu', {
-    extend: 'Ext.menu.Menu',
-
-    showSeparator: false,
-
-    controller: {
-       xclass: 'Ext.app.ViewController',
-       callCallback: function(btn) {
-           let view = this.getView();
-           if (Ext.isFunction(view.callback)) {
-               view.callback(btn.action);
-           }
-       },
-    },
+    extend: 'PMG.menu.QuarantineContextMenu',
 
     items: [
        {