issue102, when scrolling up to display photo-view, blank the screen while it's gettin...
[phpfspot.git] / phpfspot.js
index 21a027af970748a4c54afdab1b561274b58d8e31..74ad4b9958fa02c5f702f1ddeba73b7e35b3ac4b 100644 (file)
@@ -1,6 +1,13 @@
 function showImage(id, scrollup)
 {
-   HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=showphoto&id=' + id));
+   content = document.getElementById("content");
+
+   /* blank the screen */
+   if(scrollup != undefined) {
+      content.innerHTML = "";
+   }
+
+   HTML_AJAX.replace(content, encodeURI('rpc.php?action=showphoto&id=' + id));
 
    /* scroll the window up to the top */
    if(scrollup != undefined) {
@@ -8,6 +15,17 @@ function showImage(id, scrollup)
    }
 }
 
+function moveToThumb(thumb_id)
+{
+   if(thumb_id == undefined)
+      return;
+
+   if(thumbimg = document.getElementById('thumbimg' + thumb_id)) {
+      window.scrollTo(0, thumbimg.offsetTop-100);
+   }
+
+} // moveToThumb()
+
 function showCredits()
 {
    var credits = document.getElementById("content");
@@ -62,13 +80,17 @@ function refreshSelectedTags()
    selected_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_selected_tags'));
 }
 
-function showPhotoIndex(begin_with)
+function showPhotoIndex(begin_with, last_photo)
 {
-   if(begin_with == undefined)
-      HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index'));
-   else
-      HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index&begin_with=' + begin_with));
-}
+   var url = "rpc.php?action=show_photo_index";
+   if(begin_with != undefined)
+      url = url + '&begin_with=' + begin_with;
+   if(last_photo != undefined)
+      url = url + '&last_photo=' + last_photo;
+
+   HTML_AJAX.replace(document.getElementById("content"), encodeURI(url));
+
+} // showPhotoIndex()
 
 // if photo index is currently shown, refresh it
 function refreshPhotoIndex()