summaryrefslogtreecommitdiff
path: root/modules/organize
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-01-06 11:46:15 -0800
committerBharat Mediratta <bharat@menalto.com>2011-01-06 11:46:15 -0800
commitfc6907dcfe35f2341528620ccedf2db02a30d065 (patch)
tree7cda1879afde5ac942854bc3c62e4db9f35dcf76 /modules/organize
parent9682b7ea6e2486c2e5dc43799ca215c51dda0baf (diff)
Switch back to setting nodes as leaves, but fix the drop zone code to
allow dropping on leaves.
Diffstat (limited to 'modules/organize')
-rw-r--r--modules/organize/controllers/organize.php6
-rw-r--r--modules/organize/views/organize_frame.html.php7
2 files changed, 8 insertions, 5 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php
index cfd385fe..82f74c9e 100644
--- a/modules/organize/controllers/organize.php
+++ b/modules/organize/controllers/organize.php
@@ -169,6 +169,7 @@ class Organize_Controller extends Controller {
"editable" => false,
"expandable" => false,
"id" => $child->id,
+ "leaf" => $child->children_count(array(array("type", "=", "album"))) == 0,
"text" => $child->title,
"nodeType" => "async");
@@ -177,11 +178,6 @@ 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;
diff --git a/modules/organize/views/organize_frame.html.php b/modules/organize/views/organize_frame.html.php
index 13a5ff5c..cfc3933c 100644
--- a/modules/organize/views/organize_frame.html.php
+++ b/modules/organize/views/organize_frame.html.php
@@ -345,6 +345,13 @@
return returnCls;
}
+ // Override Ext.tree.TreeDropZone.getDropPoint so that it allows dropping
+ // on any node. The standard function won't let you drop on leaves, but
+ // in our model we consider an album without sub-albums a leaf.
+ v.dropZone.getDropPoint = function(e, n, dd) {
+ return "append";
+ }
+
v.dropZone.onNodeDrop = function(target, dd, e, data) {
var nodes = data.nodes;
source_ids = [];