issue103, ensure showPhotoIndex() returns to the right page
[phpfspot.git] / phpfspot.js
index ca3f9c01508fa8c94e25eae0794823d7986b8f12..21a027af970748a4c54afdab1b561274b58d8e31 100644 (file)
@@ -1,7 +1,11 @@
-function showImage(id)
+function showImage(id, scrollup)
 {
 {
-   var image_div = document.getElementById("content");
-   image_div.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=showphoto&id=' + id));
+   HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=showphoto&id=' + id));
+
+   /* scroll the window up to the top */
+   if(scrollup != undefined) {
+      window.scrollTo(0,0);
+   }
 }
 
 function showCredits()
 }
 
 function showCredits()