diff options
author | Bharat Mediratta <bharat@menalto.com> | 2011-01-06 09:49:37 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2011-01-06 09:49:37 -0800 |
commit | 514d5affa62f5646ecc7843a39b36d4fad3abbd5 (patch) | |
tree | ce23767f0a73d2652623e8043bffb79c58c0501d | |
parent | 84f287865e5382d7c01c11d1b518c97e8d2bd97b (diff) |
When generating the tree, don't mark nodes with no children as a leaf
because that confuses the TreeDropZone JS into thinking that it can't
ever have children.
-rw-r--r-- | modules/organize/controllers/organize.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 82f74c9e..eb040778 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -169,7 +169,7 @@ class Organize_Controller extends Controller { "editable" => false, "expandable" => false, "id" => $child->id, - "leaf" => $child->children_count(array(array("type", "=", "album"))) == 0, + "leaf" => false, "text" => $child->title, "nodeType" => "async"); @@ -178,6 +178,11 @@ class Organize_Controller extends Controller { $node["children"] = $this->_get_tree($child, $selected); $node["expanded"] = true; } + + if ($child->children_count(array(array("type", "=", "album"))) == 0) { + $node["children"] = array(); + $node["expanded"] = true; + } $tree[] = $node; } return $tree; |