Merge pull request #4524 from tractorcow/pulls/3/bulk-smash

BUG Fix bulk actions making sitetree unclickable
This commit is contained in:
Daniel Hensby 2015-08-21 09:31:36 +01:00
commit bb15307a8f

View File

@ -170,6 +170,7 @@
st = this.getTree(), st = this.getTree(),
ids = this.getIDs(), ids = this.getIDs(),
allIds = [], allIds = [],
viewMode = $('.cms-content-batchactions-button'),
selectedAction = this.find(':input[name=Action]').val(); selectedAction = this.find(':input[name=Action]').val();
// Default to refreshing the entire tree // Default to refreshing the entire tree
@ -180,7 +181,7 @@
} }
// If no action is selected, enable all nodes // If no action is selected, enable all nodes
if(!selectedAction || selectedAction == -1) { if(!selectedAction || selectedAction == -1 || !viewMode.hasClass('active')) {
$(rootNode).find('li').each(function() { $(rootNode).find('li').each(function() {
$(this).setEnabled(true); $(this).setEnabled(true);
}); });
@ -354,11 +355,12 @@
tree.addClass('multiple'); tree.addClass('multiple');
tree.removeClass('draggable'); tree.removeClass('draggable');
form.serializeFromTree(); form.serializeFromTree();
$('#Form_BatchActionsForm').refreshSelected();
} else { } else {
tree.removeClass('multiple'); tree.removeClass('multiple');
tree.addClass('draggable'); tree.addClass('draggable');
} }
$('#Form_BatchActionsForm').refreshSelected();
} }
}); });