issue102, when calling showImage() from photo-index, move the window to the uppest...
authorAndreas Unterkircher <unki@netshadow.at>
Fri, 18 Jan 2008 18:48:47 +0000 (19:48 +0100)
committerAndreas Unterkircher <unki@netshadow.at>
Fri, 18 Jan 2008 18:48:47 +0000 (19:48 +0100)
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
phpfspot.class.php
phpfspot.js
themes/default/templates/photo_index.tpl

index 467fdb2db1e83b5f763a93e7cb2a363a86c630bf..cf0a60c2b0a109b12d34c2b4b4202daeba3916a9 100644 (file)
@@ -520,8 +520,6 @@ class PHPFSPOT {
 
       $this->tmpl->show("single_photo.tpl");
 
-      print "<script language=\"JavaScript\">self.location.hash = '#photo';</script>\n";
-
    } // showPhoto()
 
    /**
index 2079b80b27a9329ccc4b5c3306b089421f346820..21a027af970748a4c54afdab1b561274b58d8e31 100644 (file)
@@ -1,6 +1,11 @@
-function showImage(id)
+function showImage(id, scrollup)
 {
    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()
index 909922bd0fbd1b527dabb245a1a933cd398fdb2f..717b3f21f4eaf8a61ce19a3e3e99da165b95bd4f 100644 (file)
@@ -46,7 +46,7 @@
  {section name="thumb" loop=$thumbs step=1}
   {if $images[thumb] }
     <div class="thumb" onmouseover="setBackGrdColor(this, 'mouseover');" onmouseout="setBackGrdColor(this, 'mouseout');" style="width: { $thumb_container_width }px; height: { $thumb_container_height }px;">
-     <a href="javascript:showImage({$images[thumb]});" id="{$images[thumb]}" name="image{$img_id[thumb]}" class="thumblink" onclick="click(this);" title="{$img_title[thumb]}">
+     <a href="javascript:showImage({$images[thumb]}, 'scrollup');" id="{$images[thumb]}" name="image{$img_id[thumb]}" class="thumblink" onclick="click(this);" title="{$img_title[thumb]}">
       <img class="thumb" id="{$images[thumb]}" src="phpfspot_img.php?idx={$images[thumb]}&amp;width={$width}" alt="thumb_{$images[thumb]}" width="{$img_width[thumb]}" height="{$img_height[thumb]}" />
       <br />
      {$img_name[thumb]}