summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-01-18 19:48:47 +0100
committerAndreas Unterkircher <unki@netshadow.at>2008-01-18 19:48:47 +0100
commit6dfc3761155121a3f63ef41e048dedf05b170eff (patch)
treeec7f6b696d86e2940870fbb1adeb15ff25084c3c
parent9e0069f45399b5436200c158c8fdbda3da1ffe5a (diff)
issue102, when calling showImage() from photo-index, move the window to the uppest position
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
-rw-r--r--phpfspot.class.php2
-rw-r--r--phpfspot.js7
-rw-r--r--themes/default/templates/photo_index.tpl2
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]}&amp;width={$width}" alt="thumb_{$images[thumb]}" width="{$img_width[thumb]}" height="{$img_height[thumb]}" />
<br />
{$img_name[thumb]}