summaryrefslogtreecommitdiff
path: root/modules/organize/views/organize_thumb_grid.html.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-06 21:36:17 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-06 21:52:23 -0700
commita245c57400398d2b4b1c2aea94f590a9c0a7d8a8 (patch)
treee3631c5d4a5af82a7da965f55cc918c6276118e5 /modules/organize/views/organize_thumb_grid.html.php
parentb2ef37f612f4369a72966e0efbc362039fba1734 (diff)
Further streamline the code.
Organize_Controller: * Remove unnecessary constants * Rename index() to dialog() * Simplify _get_micro_thumb_grid organize.js: * Move sizing code in here from organize_dialog.html.php organize_dialog.html.php: * Move CSS and JS links in here so that we only load them when we need them. * Move sizing code into organize.js organize_thumb_grid.html.php: * Move pagination logic in here, since it's view centric * Collapse the css class determination code and inline it
Diffstat (limited to 'modules/organize/views/organize_thumb_grid.html.php')
-rw-r--r--modules/organize/views/organize_thumb_grid.html.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/modules/organize/views/organize_thumb_grid.html.php b/modules/organize/views/organize_thumb_grid.html.php
index e6b7aec0..0d54c5c8 100644
--- a/modules/organize/views/organize_thumb_grid.html.php
+++ b/modules/organize/views/organize_thumb_grid.html.php
@@ -1,19 +1,20 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<? foreach ($children as $i => $child): ?>
- <? $item_class = "gPhoto"; ?>
- <? if ($child->is_album()): ?>
- <? $item_class = "gAlbum"; ?>
- <? endif ?>
- <li id="gMicroThumb_<?= $child->id ?>" class="gMicroThumb <?= $item_class ?>" ref="<?= $child->id ?>">
- <?= $child->thumb_img(array("class" => "gThumbnail"), $thumbsize, true) ?>
- </li>
+<? foreach ($item->children(25, $offset) as $child): ?>
+<li id="gMicroThumb_<?= $child->id ?>"
+ class="gMicroThumb <?= $child->is_album() ? "gAlbum" : "gPhoto" ?>"
+ ref="<?= $child->id ?>">
+ <?= $child->thumb_img(array("class" => "gThumbnail"), 90, true) ?>
+</li>
<? endforeach ?>
-<? if (count($children) >= 25): ?>
+
+<? if ($item->children_count() > $offset): ?>
<script>
- $.get("<?= url::site("organize/content/{$item_id}/$offset") ?>",
- function(data) {
- $("#gMicroThumbGrid").append(data);
- }
- );
+ setTimeout(function() {
+ $.get("<?= url::site("organize/content/$item->id/" . ($offset + 25)) ?>",
+ function(data) {
+ $("#gMicroThumbGrid").append(data);
+ }
+ );
+ }, 50);
</script>
-<? endif ?> \ No newline at end of file
+<? endif ?>