From 7f9db3701b7284d8597210e3b13af81b0fe80a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Wed, 15 Jun 2011 15:49:05 +0000 Subject: [PATCH] Commited code for nextmatchRowAOI to support the new EGW_SELECTMODE_TOGGLE --- etemplate/js/nextmatch_action.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/etemplate/js/nextmatch_action.js b/etemplate/js/nextmatch_action.js index 22a83c08dd..537b8d376f 100644 --- a/etemplate/js/nextmatch_action.js +++ b/etemplate/js/nextmatch_action.js @@ -15,15 +15,19 @@ * row. */ +var EGW_SELECTMODE_DEFAULT = 0; +var EGW_SELECTMODE_TOGGLE = 1; + /** * An action object interface for each nextmatch widget row - "inherits" from * egwActionObjectInterface */ -function nextmatchRowAOI(_node) +function nextmatchRowAOI(_node, _selectMode) { var aoi = new egwActionObjectInterface(); aoi.node = _node; + aoi.selectMode = _selectMode; aoi.checkBox = ($(":checkbox", aoi.node))[0]; @@ -50,9 +54,18 @@ function nextmatchRowAOI(_node) var selected = egwBitIsSet(aoi.getState(), EGW_AO_STATE_SELECTED); var state = egwGetShiftState(e); - aoi.updateState(EGW_AO_STATE_SELECTED, - !egwBitIsSet(state, EGW_AO_SHIFT_STATE_MULTI) || !selected, - state); + switch (aoi.selectMode) + { + case EGW_SELECTMODE_DEFAULT: + aoi.updateState(EGW_AO_STATE_SELECTED, + !egwBitIsSet(state, EGW_AO_SHIFT_STATE_MULTI) || !selected, + state); + break; + case EGW_SELECTMODE_TOGGLE: + aoi.updateState(EGW_AO_STATE_SELECTED, !selected, + egwSetBit(EGW_AO_SHIFT_STATE_MULTI, state, true)); + break; + } } };