diff options
-rw-r--r-- | phpfspot.class.php | 2 | ||||
-rw-r--r-- | phpfspot.js | 7 | ||||
-rw-r--r-- | themes/default/templates/photo_index.tpl | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index 467fdb2..cf0a60c 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -520,8 +520,6 @@ class PHPFSPOT { $this->tmpl->show("single_photo.tpl"); - print "<script language=\"JavaScript\">self.location.hash = '#photo';</script>\n"; - } // showPhoto() /** diff --git a/phpfspot.js b/phpfspot.js index 2079b80..21a027a 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -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() diff --git a/themes/default/templates/photo_index.tpl b/themes/default/templates/photo_index.tpl index 909922b..717b3f2 100644 --- a/themes/default/templates/photo_index.tpl +++ b/themes/default/templates/photo_index.tpl @@ -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]}&width={$width}" alt="thumb_{$images[thumb]}" width="{$img_width[thumb]}" height="{$img_height[thumb]}" /> <br /> {$img_name[thumb]} |