X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/js/kivi.LeftMenu.js diff --git a/js/kivi.LeftMenu.js b/js/kivi.LeftMenu.js new file mode 100644 index 000000000..537974e72 --- /dev/null +++ b/js/kivi.LeftMenu.js @@ -0,0 +1,22 @@ +namespace('kivi.LeftMenu', function(ns) { + 'use strict'; + ns.init = function(sections) { + sections.forEach(function(b,i){ + var a=$('').append($('').append($('
').addClass(b[3])),$('').append(b[0])); + if(b[5])a.attr('href', b[5]); + if(b[6])a.attr('target', b[6]); + $('#html-menu').append($('
').addClass(b[4]).addClass(b[1]).attr('id','mi'+b[2]).append(a)) + }); + $('#html-menu div.i, #html-menu div.sm').not('[id^='+$.cookie('html-menu-selection')+'_]').hide(); + $('#html-menu div.m#'+$.cookie('html-menu-selection')).addClass('menu-open'); + $('#html-menu div.m').each(function(){ + $(this).click(function(){ + $.cookie('html-menu-selection',$(this).attr('id')); + $('#html-menu div.mi').not('div.m').not('[id^='+$(this).attr('id')+'_]').hide(); + $('#html-menu div.mi[id^='+$(this).attr('id')+'_]').toggle(); + $('#html-menu div.m').not('[id^='+$(this).attr('id')+']').removeClass('menu-open'); + $(this).toggleClass('menu-open'); + }); + }); + }; +});