$( -> week_days_container = $('#week_days-group') $('.week-day-select').each( (i)-> select = $(this) toggle = $('') toggle.attr('data-t', 'product_category.week_days.abbreviation.'+select.data('day')) toggle.addClass('active') if select.val() == '1' week_days_container.append(toggle) toggle.click( -> select.val(Math.abs(select.val() - 1))) ) $('#full_day-controller').each -> control = $('#product_category_full_day') unless control.is(':checked') $(@).addClass('icon-white') $('#sub-day-container').removeClass('hide') $(@).click -> if control.is(':checked') control.prop 'checked', false $(@).addClass 'icon-white' $('#sub-day-container').removeClass('hide') else control.prop 'checked', true $(@).removeClass 'icon-white' $('#sub-day-container').addClass('hide') # GOOGLE LOCATION PICKER $("input.location_picker").each( (i)-> return if typeof(google) == 'undefined' location_input = $(this) map_div = $('