{I" class:ETI"BundledAsset;FI"logical_path;TI"'forever_style_guide/list-toggle.js;FI" pathname;TI"i/Users/zschweitzer/git/forever-style-guide/app/assets/javascripts/forever_style_guide/list-toggle.js;FI"content_type;TI"application/javascript;TI" mtime;Tl+°¤WI" length;Ti!I" digest;TI"%913f5b6d32f37b4c5acbc70bf08177f2;FI" source;TI"!var setup_toggle_list = function () { $(".list-group-toggler").click(function (e) { e.preventDefault(); $(this).next('.list-group-item-child').toggleClass("is_open"); $(this).find('.list-group-toggle-trigger').toggleClass("fa-plus fa-minus"); }); $('.list-group-link').on('click', function (e) { e.preventDefault(); if(!$(this).parent().hasClass('list-group-toggler')) { var checkBox = $(this).next("input[type='checkbox']"); checkBox.prop('checked', !checkBox.prop('checked')); if(checkBox.prop('checked')){ $(this).toggleClass('list-group-link-is_active'); $(this).append(''); $(this).parents('.list-group-item').addClass('is_active'); } else { $(this).toggleClass('list-group-link-is_active'); $(this).find('i').remove(); if( !$(this).parent().parents('.list-group-item').find('input:checkbox:checked').length) { $(this).parent().parents('.list-group-item').removeClass('is_active'); } } $(this).parents('form[data-listToggle]').submit(); } }); var activeListItems = $('.list-group-link-is_active'); if ($(activeListItems).length) { $(activeListItems).append(''); $(activeListItems).next("input[type='checkbox']").prop('checked', true); $(activeListItems).addClass('list-group-link-is_active'); $(activeListItems).parents('.list-group-item-child').addClass('is_open'); $(activeListItems).parents('.list-group-item').addClass('is_active'); $(activeListItems).parents('.list-group-item') .addClass('is_active') .find('.list-group-toggle-trigger .fa') .toggleClass("fa-plus fa-minus"); } }; $(document).ready(setup_toggle_list); $(document).on('page:load', setup_toggle_list); ;TI"required_assets_digest;TI"%902410316219baf265c651e83dda7813;FI" _version;TI"%2be930bcbfd3c3e00190e2193dda5c7c;F