summaryrefslogtreecommitdiff
path: root/modules/organize/views
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-30 14:35:27 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-30 14:35:27 -0700
commitd1ade6620e814ecf536dfde17c95593a311d1c2c (patch)
tree9be6f4d5e884affd81c02ec0b3468545f9b6431b /modules/organize/views
parentfd954fe86e2852c245dd599f9476fdf8ea3642e4 (diff)
Precalculate the organize tree based on the selected album and render
it right away while still allowing incremental tree loading.
Diffstat (limited to 'modules/organize/views')
-rw-r--r--modules/organize/views/organize_tree.html.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/organize/views/organize_tree.html.php b/modules/organize/views/organize_tree.html.php
index 4677234c..a99d2337 100644
--- a/modules/organize/views/organize_tree.html.php
+++ b/modules/organize/views/organize_tree.html.php
@@ -3,11 +3,17 @@
ref="<?= $album->id ?>">
<span class="ui-icon ui-icon-minus">
</span>
- <span class="gAlbumText" ref="<?= $album->id ?>">
+ <span class="gAlbumText
+ <?= $album->id == $selected->id ? "selected" : "" ?>
+ "
+ ref="<?= $album->id ?>">
<?= p::clean($album->title) ?>
</span>
<ul>
<? foreach ($album->children(null, 0, array("type" => "album")) as $child): ?>
+ <? if ($child->is_descendant($selected)): ?>
+ <?= View::factory("organize_tree.html", array("selected" => $selected, "album" => $child)); ?>
+ <? else: ?>
<li class="gOrganizeAlbum ui-icon-left <?= access::can("edit", $child) ? "" : "gViewOnly" ?>"
ref="<?= $child->id ?>">
<span class="ui-icon ui-icon-plus">
@@ -16,6 +22,7 @@
<?= p::clean($child->title) ?>
</span>
</li>
+ <? endif ?>
<? endforeach ?>
</ul>
</li>