Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 345731a4

Von Sven Schöling vor etwa 12 Jahren hinzugefügt

  • ID 345731a4ff5c1f84b755be776027ddd0407a97fa
  • Vorgänger a8e5264c
  • Nachfolger 16fa52a0

Menü gefixt und richtig gestyled

Unterschiede anzeigen:

bin/mozilla/menu.pl
128 128

  
129 129
    if (!$level) { # toplevel
130 130
      push @items, make_item(
131
        href     => '#',
132 131
        img      =>  make_image(icon => $item . '.png', size => 24, label => $label),
133 132
        label    => $label,
134 133
        height   => 24,
css/lx-office-erp/menu.css
300 300
#html-menu a { vertical-align: top }
301 301
#html-menu .item span.menu-spacer { display: inline-block; width: 24px }
302 302
#html-menu .menu span.menu-spacer { display: inline-block; width: 32px }
303
#html-menu div.menu div.menuitemchunk { color:blue;}
304
#html-menu div.menu div.menuitemchunk:hover { color:blue; background-color: lemonchiffon; cursor: pointer; }
303 305

  
templates/webpages/menu/menu.html
4 4
<div id='html-menu'>
5 5
  [% INCLUDE sections %]
6 6
</div>
7
<script type='text/javascript'>
8
  $(function(){
9
    $('#html-menu div.menu-submenu').hide();
10
    $('#html-menu div.menu').each(function() {
11
      $(this).click(function(){
12
        $('#html-menu div.menu-submenu').not('#' + $(this).attr('id') + '_submenu').hide();
13
        $('#' + $(this).attr('id') + '_submenu').toggle();
14
      });
15
    });
16
  });
17
</script>
7 18
</body>
8 19
</html>
9 20
[%- BLOCK sections %]
10 21
[%- FOREACH item IN sections %]
11 22
 <div class='menu-multiline'>
12 23
 [% SET menuouterloopcount = loop.count %]
13
 [%- FOREACH chunk IN item.chunks %]
14
   <div id='menuitem[% menulevel %]_[% menuouterloopcount %]' class='menuitem [% item.class %] hover'>[% PROCESS item %]</div>
15
 [%- END %]
24
  <div id='menuitem[% menulevel %]_[% menuouterloopcount %]' class='menuitem [% item.class %] hover'>
25
   [%- FOREACH chunk IN item.chunks %]
26
   <div class='menuitemchunk hover'>[% PROCESS item %]</div>
27
   [%- END %]
28
  </div>
16 29
   [%- IF item.subitems.size %]
17 30
   <div id='menuitem[% menulevel %]_[% loop.count %]_submenu' class='menu-submenu[% menulevel %]'>
18
   [% INCLUDE sections sections=item.subitems, menulevel='_'+loop.count %]
31
   [% INCLUDE sections sections=item.subitems, menulevel= menulevel _ '_' _ loop.count %]
19 32
   </div>
20 33
  [%- END %]
21 34
 </div>
......
24 37
[%- BLOCK item %]
25 38
  [% item.spacer %]
26 39
  [%- IF item.href %]
27
    [% L.link(item.href, L.html_tag('span', L.html_tag('img', undef, item.img), class='menu-spacer') _ chunk, target=item.target) %]
40
    [% L.link(item.href, L.html_tag('span', L.img_tag(item.img), class='menu-spacer') _ chunk, class='menu-link', target=item.target) %]
28 41
  [%- ELSE %]
29
    [% L.html_tag('img', undef, item.img) _ chunk %]
42
    [% L.img_tag(item.img) _ chunk %]
30 43
  [%- END %]
31 44
[%- END %]
32

  
33
</body>
34

  
35
<script type='text/javascript'>
36
  $(function(){
37
    $('#html-menu div.menu-submenu').hide();
38
    $('#html-menu div.menu, #html-menu div.submenu').each(function() {
39
      $(this).click(function(){
40
        $('#html-menu div.menu-submenu').not('#' + $(this).attr('id') + '_submenu').hide();
41
        $('#' + $(this).attr('id') + '_submenu').toggle();
42
      });
43
    });
44
  });
45
</script>
46

  
47
</html>

Auch abrufbar als: Unified diff