From: Andreas Unterkircher Date: Fri, 18 Jan 2008 18:48:47 +0000 (+0100) Subject: issue102, when calling showImage() from photo-index, move the window to the uppest... X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=commitdiff_plain;h=6dfc3761155121a3f63ef41e048dedf05b170eff issue102, when calling showImage() from photo-index, move the window to the uppest position Signed-off-by: Andreas Unterkircher --- 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 "\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] }