Changeset 3491 in products


Ignore:
Timestamp:
Aug 9, 2012 3:56:44 PM (12 years ago)
Author:
kroman0
Message:

Added select for mobile menu

Location:
quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/resources/drop_down.css

    r3450 r3491  
    9595  color:#205C90; 
    9696  } 
     97#portal-globalnav-mobile { 
     98  display:none; 
     99  } 
    97100 
     101@media (max-width:5in) { 
     102#portal-globalnav.mobileMenuOn { 
     103  display:none; 
     104  } 
     105#portal-globalnav-mobile { 
     106  display:block; 
     107  margin:0.5em; 
     108  min-width:150px; 
     109  }    
     110} 
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections.pt

    r3458 r3491  
    22          tal:condition="menu" 
    33          i18n:domain="plone"> 
    4     <ul id="portal-globalnav"> 
     4    <ul id="portal-globalnav" tal:attributes="class python:view.conf.mobile_menu and 'mobileMenuOn' or ''"> 
    55        <li tal:replace="structure menu"> 
    66            DropDown Menu 
    77        </li> 
    88    </ul> 
     9    <select id="portal-globalnav-mobile" 
     10            tal:condition="view/conf/mobile_menu" 
     11            tal:content="structure view/createMenuMobile" 
     12            onchange="location = this.options[this.selectedIndex].value;"> 
     13        <option value="" selected="selected">Menu</option> 
     14    </select> 
    915</tal:tabs> 
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py

    r3461 r3491  
    7979    index = ViewPageTemplateFile('templates/sections.pt') 
    8080    recurse = ViewPageTemplateFile('templates/sections_recurse.pt') 
     81    mobile = ViewPageTemplateFile('templates/sections_mobile.pt') 
    8182 
    8283    def update(self): 
     
    255256 
    256257    @dropdowncache 
     258    def createMenuMobile(self): 
     259        html = self.mobile(children=self.portal_tabs(), level=1) 
     260        return xhtmlslimmer.compress(html).strip('\n') 
     261 
     262    @dropdowncache 
    257263    def createMenu(self): 
    258264        html = self.recurse(children=self.portal_tabs(), level=1) 
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/interfaces.py

    r3348 r3491  
    9393 
    9494    caching_strategy = schema.Choice( 
    95     title=_(u"Select caching strategy"), 
    96     description=_(u"Caching strategy defines how the cache key will be built." 
    97                  ), 
    98     default="anonymous", 
    99     vocabulary=cachings 
    100     ) 
     95        title=_(u"Select caching strategy"), 
     96        description=_(u"Caching strategy defines how the cache key will be " 
     97                      u"built."), 
     98        default="anonymous", 
     99        vocabulary=cachings 
     100        ) 
     101 
     102    mobile_menu = schema.Bool( 
     103        title=_(u"Display menu as select for small screens"), 
     104        description=_(u"Use select tag to display menu for small screens"), 
     105        default=False, 
     106        ) 
Note: See TracChangeset for help on using the changeset viewer.