mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #832 from halkyon/sitetree_children_disabled
BUG If a nested page editable but parent not, user can't expand tree
This commit is contained in:
commit
ea86b96fbb
@ -649,7 +649,7 @@ form.import-form label.left { width: 250px; }
|
||||
.cms .jstree a > .jstree-icon, .TreeDropdownField .treedropdownfield-panel .jstree a > .jstree-icon { margin-right: 3px; }
|
||||
.cms .jstree li.jstree-open > ul, .TreeDropdownField .treedropdownfield-panel .jstree li.jstree-open > ul { display: block; }
|
||||
.cms .jstree li.jstree-closed > ul, .TreeDropdownField .treedropdownfield-panel .jstree li.jstree-closed > ul { display: none; }
|
||||
.cms .jstree li.disabled a, .TreeDropdownField .treedropdownfield-panel .jstree li.disabled a { color: #aaaaaa; }
|
||||
.cms .jstree li.disabled > a, .TreeDropdownField .treedropdownfield-panel .jstree li.disabled > a { color: #aaaaaa; }
|
||||
.cms .jstree-rtl a > .jstree-icon, .TreeDropdownField .treedropdownfield-panel .jstree-rtl a > .jstree-icon { margin-left: 3px; margin-right: 0; }
|
||||
.cms .jstree-rtl li, .TreeDropdownField .treedropdownfield-panel .jstree-rtl li { margin-left: 0; margin-right: 18px; }
|
||||
.cms .jstree-rtl > ul > li, .TreeDropdownField .treedropdownfield-panel .jstree-rtl > ul > li { margin-right: 0px; }
|
||||
|
@ -75,9 +75,12 @@
|
||||
}
|
||||
|
||||
if($.inArray(data.func, ['check_node', 'uncheck_node'])) {
|
||||
//Don't allow check and uncheck if parent is disabled
|
||||
// don't allow check and uncheck if parent is disabled
|
||||
var node = $(data.args[0]).parents('li:first');
|
||||
if(node.hasClass('disabled')) {
|
||||
var allowedChildren = node.find('li:not(.disabled)');
|
||||
|
||||
// if there are child nodes that aren't disabled, allow expanding the tree
|
||||
if(node.hasClass('disabled') && allowedChildren == 0) {
|
||||
e.stopImmediatePropagation();
|
||||
return false;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
li.disabled a {
|
||||
li.disabled > a {
|
||||
color: #aaaaaa;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user