Precalculate the organize tree based on the selected album and render

it right away while still allowing incremental tree loading.
This commit is contained in:
Bharat Mediratta
2009-08-30 14:35:27 -07:00
parent fd954fe86e
commit d1ade6620e
2 changed files with 20 additions and 6 deletions
@@ -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>