X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;ds=sidebyside;f=www%2Fplugins%2Fauto%2FnoiZetier%2Fjavascript%2Fnoizetier.js;fp=www%2Fplugins%2Fauto%2FnoiZetier%2Fjavascript%2Fnoizetier.js;h=97b0969d857597debca090c2df78408b1f91dc5c;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hp=0000000000000000000000000000000000000000;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c;p=velocampus%2Fweb%2Fwww.git diff --git a/www/plugins/auto/noiZetier/javascript/noizetier.js b/www/plugins/auto/noiZetier/javascript/noizetier.js new file mode 100644 index 0000000..97b0969 --- /dev/null +++ b/www/plugins/auto/noiZetier/javascript/noizetier.js @@ -0,0 +1,31 @@ +$(function(){ + noizetier_parametres_pliable(); + onAjaxLoad(noizetier_parametres_pliable); +}); + +function noizetier_parametres_pliable(){ + // On cherche les blocs pliables + $('li.noisette') + .each(function(){ + var li = $(this); + var infos = $(this).find('div.infos'); + var titre = $(this).find('div.titre'); + + // S'il est déjà plié on cache le contenu + if (li.is('.plie')) + infos.hide(); + + // Ensuite on ajoute une action sur le titre + titre + .unbind('click') + .click( + function(){ + li.toggleClass('plie'); + if (infos.is(':hidden')) + infos.show(); + else + infos.hide(); + } + ); + }); +};