Ignore:
Timestamp:
Feb 23, 2013, 8:24:04 AM (11 years ago)
Author:
rvelices
Message:
  • replaced calendar views select with a drop down box (as sort order and photo sizes)
  • some css compaction
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/default/template/index.tpl

    r20452 r20982  
    119119{if isset($chronology_views)}
    120120<div class="calendarViews">{'View'|@translate}:
    121         <select onchange="document.location = this.options[this.selectedIndex].value;">
    122                 {foreach from=$chronology_views item=view}
    123                 <option value="{$view.VALUE}"{if $view.SELECTED} selected="selected"{/if}>{$view.CONTENT}</option>
     121        <a id="calendarViewSwitchLink" href="javascript:toggleCalendarViewsBox()">
     122        {foreach from=$chronology_views item=view}{if $view.SELECTED}{$view.CONTENT}{/if}{/foreach}
     123        </a>
     124        <div id="calendarViewSwitchBox" class="switchBox">
     125                {foreach from=$chronology_views item=view name=loop}{if !$smarty.foreach.loop.first}<br>{/if}
     126                <span{if !$view.SELECTED} style="visibility:hidden"{/if}>&#x2714; </span><a href="{$view.VALUE}">{$view.CONTENT}</a>
    124127                {/foreach}
    125         </select>
     128        </div>
     129        {footer_script require='jquery'}{literal}
     130function toggleCalendarViewsBox() {
     131        var elt = jQuery("#calendarViewSwitchBox")
     132                , ePos = jQuery("#calendarViewSwitchLink");
     133        elt.css("left", Math.min( ePos.offset().left, jQuery(window).width() - elt.outerWidth(true) - 5))
     134                .css("top", ePos.offset().top + ePos.outerHeight(true))
     135                .toggle();
     136};
     137jQuery("#calendarViewSwitchBox").on("mouseleave", function() {
     138        jQuery(this).hide();
     139});
     140        {/literal}{/footer_script}
    126141</div>
    127142{/if}
Note: See TracChangeset for help on using the changeset viewer.