From 26eaf7e1fef4f1e850e34eea4365a68b1c48b591 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 11 Mar 2014 16:25:18 +0000 Subject: [PATCH] Add a isDefault flag to allow changing default execution function --- phpgwapi/js/egw_action/egw_action.js | 1 + phpgwapi/js/egw_action/egw_action_common.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/phpgwapi/js/egw_action/egw_action.js b/phpgwapi/js/egw_action/egw_action.js index 90f1f08c24..99036178c8 100644 --- a/phpgwapi/js/egw_action/egw_action.js +++ b/phpgwapi/js/egw_action/egw_action.js @@ -534,6 +534,7 @@ egwAction.prototype.setDefaultExecute = function(_value) // Check whether the onExecute handler of this action should be set if (this.type != "actionManager" && !this.onExecute.hasHandler()) { + this.onExecute.isDefault = true; this.onExecute.setValue(_value); } diff --git a/phpgwapi/js/egw_action/egw_action_common.js b/phpgwapi/js/egw_action/egw_action_common.js index f3bd06f8cf..8c4b645bf5 100644 --- a/phpgwapi/js/egw_action/egw_action_common.js +++ b/phpgwapi/js/egw_action/egw_action_common.js @@ -343,12 +343,14 @@ function egwFnct(_context, _default, _acceptedTypes) this.acceptedTypes = _acceptedTypes; this.fnct = null; this.value = null; + // Flag for if this action is using a default handler + this.isDefault = false; this.setValue(_default); } egwFnct.prototype.hasHandler = function() { - return this.fnct !== null; + return this.fnct !== null && !this.isDefault; } /**