Make sure the "focus" parameter works also for the first image in the album.

This commit is contained in:
Knut Forkalsrud 2011-03-30 18:37:10 -07:00
parent 12b91ab1ec
commit 22f10bd11b

View file

@ -81,7 +81,7 @@ $(document).ready(function() {
return captionElement.innerHTML; return captionElement.innerHTML;
} }
var selectedImg = window.location.search; var selectedImg = window.location.search;
var selectedPos; var selectedPos = undefined;
if (/^\?focus=/.test(selectedImg)) { if (/^\?focus=/.test(selectedImg)) {
selectedImg = selectedImg.substring('?focus='.length); selectedImg = selectedImg.substring('?focus='.length);
$("a.ss").each(function(index) { $("a.ss").each(function(index) {
@ -98,7 +98,7 @@ $(document).ready(function() {
'easingOut' : 'easeOutQuad', 'easingOut' : 'easeOutQuad',
'titleFormat' : formatTitle 'titleFormat' : formatTitle
}); });
if (selectedPos) { if (selectedPos !== undefined) {
$(gallery[selectedPos]).trigger('click'); $(gallery[selectedPos]).trigger('click');
} }
}) })