Product category improvements

This commit is contained in:
2013-02-26 09:40:29 +01:00
parent 0c3bec5c4a
commit 08333cb1bb
6 changed files with 42 additions and 9 deletions
@@ -1,13 +1,30 @@
$( ->
week_days_container = $('#week_days-group')
$('.week-day-select').each( (i)->
select = $(this)
container = select.siblings('.btn-group')
toggle = $('<button type="button" class="btn"></button>')
toggle.attr('data-t', 'product_category.week_days.abbreviation.'+select.data('day'))
toggle.addClass('active') if select.val() == '1'
container.append(toggle)
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'