/* ------- checklist js scroll ------- */ function checklist_content(checklist, first){ var list = checklist.siblings('.scroll_checklist_hide').children('.scroll_checklist_content'); var selected = ""; if (first) { checklist.after(''); } var limit = checklist.siblings('.checklist_nbr_limit').val(); var separator = checklist.siblings('.checklist_selected_separator').val(); var prefix = checklist.siblings('.checklist_selected_prefix').val(); var suffix = checklist.siblings('.checklist_selected_suffix').val(); var max_displayed = checklist.siblings('.checklist_selected_max_display').val(); var nbr = 0; var nbr_total = 0; list.children('div:not(.noCountCheck)').children('input[type=checkbox]').each(function(){ if ($(this).is(':checked')) { if (nbr!=0) { selected += separator; } else { } selected += prefix+$(this).siblings('label').html()+suffix; nbr++; } nbr_total++; }); //For account 13 special code! $('.source_checkbox').each(function(){ if ($(this).is(':checked')) { if (nbr!=0) { selected += separator; } else { } selected += prefix+$(this).parent('span').siblings('label').html()+suffix; nbr++; } nbr_total++; }); if (nbr == 0) { checklist.html(checklist.siblings('.checklist_button_base').val()); } else if (nbr > limit) { if (max_displayed) { checklist.html(nbr+'/'+nbr_total+checklist.siblings('.checklist_elements_label').val()); } else { checklist.html(nbr+checklist.siblings('.checklist_elements_label').val()); } } else { checklist.html('
'+selected+'
'); } } $('.scroll_checklist_dynamic_values .scroll_checklist_hide input[type=checkbox]').change(function(){ var checklist = $(this).parents('.scroll_checklist_hide').siblings('.scroll_checklist_button'); if (!checklist.hasClass('no_list_selected')) { checklist_content(checklist, false); } }); function checklist_js_scroll(){ var multiIndex=0; if($('div').hasClass('scroll_checklist_hide')){ $('.scroll_checklist_button').click(function(){ var checklist = $(this).parent(); if (!checklist.hasClass('scroll_checklist_open')) { checklist.addClass('scroll_checklist_open'); $(".scroll_checklist_hide", checklist).stop(true, true).slideDown(); multiIndex++; checklist.css({zIndex:60+multiIndex}); } else { $(".scroll_checklist_hide", checklist).stop(true, true).slideUp(function(){ checklist.removeClass('scroll_checklist_open'); checklist.css({zIndex:"1"}); }); } }); } if(document.getElementById('post_objects_filter')){ function scroll_result(nbr){ if($(".scroll_checklist_hide").css('display')=="none"){ $(".scroll_checklist_hide").slideDown(); $(".scroll_checklist_"+nbr).addClass('scroll_checklist_open'); multiIndex++; $(".scroll_checklist_"+nbr).css({zIndex:60+multiIndex}); }else{ $(".scroll_checklist_hide").slideUp(function(){ $(".scroll_checklist_"+nbr).removeClass('scroll_checklist_open'); $(".scroll_checklist_"+nbr).css({zIndex:"1"}); }); } } } } $(window).load(function() { checkListScrollLoad(); }); function checkListScrollLoad() { checklist_js_scroll(); $('.scroll_checklist_dynamic_values .scroll_checklist_button').each(function(){ if (!$(this).hasClass('no_list_selected')) { checklist_content($(this), true); } }); $('.scroll_checklist_dynamic_values .scroll_checklist_hide input[type=checkbox]').change(function(){ var checklist = $(this).parents('.scroll_checklist_hide').siblings('.scroll_checklist_button'); if (!checklist.hasClass('no_list_selected')) { checklist_content(checklist, false); } }); }