mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Open selected node by default when entering batch actions to trigger loading of children and avoid "missed" nodes in any batch selection
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@81459 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
fece6769fe
commit
7147a863b8
@ -296,12 +296,20 @@ batchactionsclass.prototype = {
|
||||
|
||||
batchActionGlobals.selectedNodes = { };
|
||||
|
||||
var sel = $('sitetree').firstSelected();
|
||||
if(sel && sel.className.indexOf('nodelete') == -1) {
|
||||
var selIdx = $('sitetree').getIdxOf(sel);
|
||||
var selectedNode = $('sitetree').firstSelected();
|
||||
if(selectedNode && selectedNode.className.indexOf('nodelete') == -1) {
|
||||
var selIdx = $('sitetree').getIdxOf(selectedNode);
|
||||
batchActionGlobals.selectedNodes[selIdx] = true;
|
||||
sel.removeNodeClass('current');
|
||||
sel.addNodeClass('selected');
|
||||
selectedNode.removeNodeClass('current');
|
||||
selectedNode.addNodeClass('selected');
|
||||
selectedNode.open();
|
||||
|
||||
// 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<children.length; i++) {
|
||||
children[i].open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -315,7 +323,6 @@ batchActionGlobals = {
|
||||
newNodes: { },
|
||||
treeSelectionChanged : function(selectedNode) {
|
||||
var idx = $('sitetree').getIdxOf(selectedNode);
|
||||
|
||||
if(selectedNode.className.indexOf('nodelete') == -1) {
|
||||
if(selectedNode.selected) {
|
||||
selectedNode.removeNodeClass('selected');
|
||||
|
Loading…
Reference in New Issue
Block a user