aboutsummaryrefslogtreecommitdiffstats
path: root/themes/default/template/index.tpl
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2013-02-23 07:24:04 +0000
committerrvelices <rv-github@modusoptimus.com>2013-02-23 07:24:04 +0000
commit1c9a69ba0a7f48bc507d94ad3d96533cacccbf3b (patch)
treeac81ceee410228e01e7b50de684f19f6a75e4e07 /themes/default/template/index.tpl
parentff678083b6278ed4231105d826e21543e19b1a1c (diff)
- replaced calendar views select with a drop down box (as sort order and photo sizes)
- some css compaction git-svn-id: http://piwigo.org/svn/trunk@20982 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes/default/template/index.tpl')
-rw-r--r--themes/default/template/index.tpl23
1 files changed, 19 insertions, 4 deletions
diff --git a/themes/default/template/index.tpl b/themes/default/template/index.tpl
index c24f4e364..3ed52498c 100644
--- a/themes/default/template/index.tpl
+++ b/themes/default/template/index.tpl
@@ -118,11 +118,26 @@ jQuery("#derivativeSwitchBox").on("mouseleave", function() {
{if isset($chronology_views)}
<div class="calendarViews">{'View'|@translate}:
- <select onchange="document.location = this.options[this.selectedIndex].value;">
- {foreach from=$chronology_views item=view}
- <option value="{$view.VALUE}"{if $view.SELECTED} selected="selected"{/if}>{$view.CONTENT}</option>
+ <a id="calendarViewSwitchLink" href="javascript:toggleCalendarViewsBox()">
+ {foreach from=$chronology_views item=view}{if $view.SELECTED}{$view.CONTENT}{/if}{/foreach}
+ </a>
+ <div id="calendarViewSwitchBox" class="switchBox">
+ {foreach from=$chronology_views item=view name=loop}{if !$smarty.foreach.loop.first}<br>{/if}
+ <span{if !$view.SELECTED} style="visibility:hidden"{/if}>&#x2714; </span><a href="{$view.VALUE}">{$view.CONTENT}</a>
{/foreach}
- </select>
+ </div>
+ {footer_script require='jquery'}{literal}
+function toggleCalendarViewsBox() {
+ var elt = jQuery("#calendarViewSwitchBox")
+ , ePos = jQuery("#calendarViewSwitchLink");
+ elt.css("left", Math.min( ePos.offset().left, jQuery(window).width() - elt.outerWidth(true) - 5))
+ .css("top", ePos.offset().top + ePos.outerHeight(true))
+ .toggle();
+};
+jQuery("#calendarViewSwitchBox").on("mouseleave", function() {
+ jQuery(this).hide();
+});
+ {/literal}{/footer_script}
</div>
{/if}