From 119121b0f263474bdaa11888c3fc0790416db354 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 9 Jul 2009 05:36:24 +0000 Subject: [PATCH] BUGFIX Open selected node and immediate child nodes when using batch actions to ensure that all nodes can actually be selected. This will optionally trigger ajax loading for further nodes git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@81457 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/CMSMain_left.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/javascript/CMSMain_left.js b/javascript/CMSMain_left.js index 423d7c20..46200b3f 100755 --- a/javascript/CMSMain_left.js +++ b/javascript/CMSMain_left.js @@ -323,9 +323,22 @@ batchActionGlobals = { batchActionGlobals.selectedNodes[idx] = false; } else { + // Open node in order to allow proper selection of children + if(Element.hasClassName(selectedNode, 'unexpanded')) { + selectedNode.open(); + } + + // Select node selectedNode.addNodeClass('selected'); selectedNode.selected = true; batchActionGlobals.selectedNodes[idx] = true; + + // Open all existing children, which might trigger further + // ajaxExansion calls to ensure all nodes are selectable + var children = selectedNode.getElementsByTagName('li'); + for(var i=0; i