my $anchor = $menuitem->{href};
my %common_args = (
- label => $label,
- spacer => $spacer,
- target => $menuitem->{target},
- item_id => "$id_prefix\_$id",
+ l => $label,
+ s => $spacer,
+ t => $menuitem->{target},
+ id => "$id_prefix\_$id",
height => 16,
);
if (!$level) { # toplevel
push @items, { %common_args,
- img => "icon24 $icon_class", # make_image(size => 24, label => $item),
- height => 24,
- class => 'm',
+ i => "icon24 $icon_class", # make_image(size => 24, label => $item),
+ c => 'm',
};
push @items, section_menu($menu, $item, "$id_prefix\_$id");
} elsif ($menuitem->{submenu}) {
push @items, { %common_args,
- img => "icon16 submenu", #make_image(label => 'submenu'),
- class => 'sm',
+ i => "icon16 submenu", #make_image(label => 'submenu'),
+ c => 'sm',
};
push @items, section_menu($menu, $item, "$id_prefix\_$id");
} elsif ($menuitem->{module}) {
push @items, { %common_args,
- img => "icon16 $icon_class", #make_image(size => 16, label => $item),
- href => $anchor,
- class => 'i',
+ i => "icon16 $icon_class", #make_image(size => 16, label => $item),
+ h => $anchor,
+ c => 'i',
};
}
} continue {
<body class="menu">
<div id='html-menu'>
</div>
-<script type='text/javascript'>
- $(function(){
- $([% JSON.json(sections) %]).each(function(i,b){
- var a = $('<a class="ml">').append(
- $('<span class="mii ms">').append($('<div>').addClass(b.img)),
- $('<span class="mic">').append(b.label));
- if (b.href) a.attr('href', b.href);
- if (b.target) a.attr('target', b.target);
- $('#html-menu').append($('<div class="mi">').addClass(b.class).addClass(b.spacer).attr('id', 'mi' + b.item_id).append(a));
- });
- $('#html-menu div.i, #html-menu div.sm').hide();
- $('#html-menu div.m').each(function() {
- $(this).click(function(){
- $('#html-menu div.mi').not('div.m').not('[id^=' + $(this).attr('id') + '_]').hide();
- $('#html-menu div.mi[id^=' + $(this).attr('id') + '_]').toggle();
- });
- });
- });
-</script>
+<script type='text/javascript'>$(function(){$([% JSON.json(sections) %]).each(function(i,b){var a=$('<a class="ml">').append($('<span class="mii ms">').append($('<div>').addClass(b.i)),$('<span class="mic">').append(b.l));if(b.h)a.attr('href', b.h);if(b.t)a.attr('target', b.t);$('#html-menu').append($('<div class="mi">').addClass(b.c).addClass(b.s).attr('id','mi'+b.id).append(a));});$('#html-menu div.i, #html-menu div.sm').hide();$('#html-menu div.m').each(function(){$(this).click(function(){$('#html-menu div.mi').not('div.m').not('[id^='+$(this).attr('id')+'_]').hide();$('#html-menu div.mi[id^='+$(this).attr('id')+'_]').toggle()})})})</script>
</body>
</html>