From 8e9279c7b707c7712cd9d8e2e128e5dc8937f12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Sun, 17 Apr 2011 17:55:37 +0000 Subject: [PATCH] passing new checkbox state to underlying menu implementation after action execution --- phpgwapi/js/egw_action/egw_action_popup.js | 13 +++++++++++-- phpgwapi/js/egw_action/test/test_action.html | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/phpgwapi/js/egw_action/egw_action_popup.js b/phpgwapi/js/egw_action/egw_action_popup.js index ee9857d0da..bf91b6dbb3 100644 --- a/phpgwapi/js/egw_action/egw_action_popup.js +++ b/phpgwapi/js/egw_action/egw_action_popup.js @@ -323,8 +323,17 @@ function egwPopupActionImplementation() { item.set_onClick(function(elem) { // Copy the "checked" state - elem.data.checked = elem.checked; - return elem.data.execute(_selected, _target); + if (typeof elem.data.checked != "undefined") + { + elem.data.checked = elem.checked; + } + + elem.data.execute(_selected, _target); + + if (typeof elem.data.checkbox != "undefined" && elem.data.checkbox) + { + return elem.data.checked; + } }); } else diff --git a/phpgwapi/js/egw_action/test/test_action.html b/phpgwapi/js/egw_action/test/test_action.html index 851e0731b9..ee4aa1ae89 100644 --- a/phpgwapi/js/egw_action/test/test_action.html +++ b/phpgwapi/js/egw_action/test/test_action.html @@ -350,7 +350,7 @@ "checked": false, "caption": "Test2", "onExecute": function(_action) { - return false; + _action.checked = true; } } ]