One possible solution (not tested).

1 step) in static/js create a new file named "web2py_metroui.js" having the 
following contents

jQuery(function(){
  jQuery('.menu>li.dropdown').each(function(){
      jQuery(this).attr({'class':'','data-role':'dropdown'});
  });
  jQuery('.menu li li').each(function(){
    if(jQuery(this).find('ul').length)
      jQuery(this).addClass('dropdown-submenu');
  });
});

2 step) in layout.html 
a) replace existing line with (note the voice "menu")
{{=MENU(response.menu, _class='mobile-menu nav' if is_mobile else 'nav menu'
, mobile=is_mobile,  li_class='dropdown',  ul_class='dropdown-menu')}}

b) replace this line
<script src="{{=URL('static','js/web2py_bootstrap.js')}}"></script>
with
<script src="{{=URL('static','js/web2py_metroui.js')}}"></script>

c) remove all other refererences to bootstrap.


Il giorno sabato 29 dicembre 2012 16:11:29 UTC+1, Sverre ha scritto:
>
> I'm trying to write a layout plugin with the styles of 
> http://metroui.org.ua . A problem is, that he is using custom data in the 
> menu definitions like 
>  
>
>>             <ul class="menu">
>>                 <li data-role="dropdown">
>>                     <a href="#">Item 1</a>
>>                     <ul class="dropdown-menu">
>>                         <li><a href="#">SubItem</a></li>
>>                         ...
>>                         <li><a href="#">SubItem</a></li>
>>  
>>
>>
> So either I have to extend the MENU function or I have to find a another 
> solution. Has someone a hint?
>
> Thx in advance
>
>
>
>  
>

-- 



Reply via email to