quarantine: refactor action logic

so that it can be reused

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-03-28 16:55:43 +02:00 committed by Dietmar Maurer
parent 5fb0f71ea0
commit 7f0619ff3b

View File

@ -91,13 +91,19 @@ Ext.define('PMG.SpamQuarantine', {
},
btnHandler: function(button, e) {
var me = this;
var action = button.reference;
var list = this.lookupReference('list');
var selected = list.getSelection();
me.doAction(action, selected);
},
doAction: function(action, selected) {
if (!selected.length) {
return;
}
var action = button.reference;
var list = this.lookupReference('list');
if (selected.length > 1) {
var idlist = [];