From f61853700d67c42765474073b2f41c6cd230ac07 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 11 Jul 2009 19:14:13 +0000 Subject: [PATCH] add inline JavaScript variable to indicate slider direction (addresses #46) --- index.php | 7 +++++-- themes/default_horizontal/theme.php | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 138d682..644a3a5 100644 --- a/index.php +++ b/index.php @@ -56,14 +56,17 @@ $styles = array('css/jquery.lightbox.css'); $template = $theme->getTemplate(); if ($theme->themetype == 'horizontal') { - $inlinestyles = sprintf("\n#scrollable { width:%dpx; }\n", $thumbinfo[0]); + $inlinestyles = sprintf("#scrollable { width:%dpx; }\n", $thumbinfo[0]); + $inlinescript = "var themetype='horizontal';"; } else { - $inlinestyles = sprintf("\n#scrollable { height:%dpx; }\n", $thumbinfo[0]); + $inlinestyles = sprintf("#scrollable { height:%dpx; }\n", $thumbinfo[0]); + $inlinescript = "var themetype='vertical';"; } $template->assign('scripts', $scripts); $template->assign('styles', $styles); $template->assign('inlinestyle', $inlinestyles); +$template->assign('inlinescript', $inlinescript); $template->assign('title', getGalleryTitle($thumbinfo)); $template->assign('gallerylinks', getGalleryLinks()); $template->assign('thumbnails', getAllThumbnails($thumbinfo)); diff --git a/themes/default_horizontal/theme.php b/themes/default_horizontal/theme.php index e1f5763..c0936e5 100644 --- a/themes/default_horizontal/theme.php +++ b/themes/default_horizontal/theme.php @@ -24,12 +24,16 @@ a:active { } - + + - +