From d59b62c39fb3db70b0ecbeb96cca3247bdc7d755 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 26 Nov 2020 21:11:58 +0300 Subject: [PATCH] simplification... Signed-off-by: Alex A. Naanou --- Viewer/features/core.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Viewer/features/core.js b/Viewer/features/core.js index 09ff2b47..814de054 100755 --- a/Viewer/features/core.js +++ b/Viewer/features/core.js @@ -2477,17 +2477,21 @@ var TaskActions = actions.Actions({ config: { }, - // actions that generate tasks... + // tests... + isTask: function(action){ + return !!this.getActionAttr(action, '__task__') }, + isSessionTask: function(action){ + return !!this.getActionAttr(action, '__session_task__') }, + + // list actions that generate tasks... // // XXX cache these??? get taskActions(){ - return this.actions - .filter(function(action){ - return !!this.getActionAttr(action, '__task__') }.bind(this)) }, + var test = this.isTask.bind(this) + return this.actions.filter(test) }, get sessionTaskActions(){ - return this.actions - .filter(function(action){ - return !!this.getActionAttr(action, '__session_task__') }.bind(this)) }, + var test = this.isSessionTask.bind(this) + return this.actions.filter(test) }, // task manager... //