Start with supplier foundation style
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
$ ->
|
||||
$('.week-day-toggle').each ->
|
||||
select = $('#week-day-select-'+$(@).data('day'))
|
||||
$(@).addClass('active') if select.val() == '1'
|
||||
$(@).click( -> select.val(Math.abs(select.val() - 1)))
|
||||
|
||||
$('#full_day-controller').each ->
|
||||
control = $('#product_category_full_day')
|
||||
if control.is(':checked')
|
||||
$('#sub-day-container').removeClass('hide')
|
||||
$(@).removeClass 'active'
|
||||
else
|
||||
$(@).addClass('active')
|
||||
$(@).click ->
|
||||
if control.is(':checked')
|
||||
control.prop 'checked', false
|
||||
$(@).removeClass 'active'
|
||||
$('#sub-day-container').removeClass('hide')
|
||||
else
|
||||
$(@).addClass 'active'
|
||||
control.prop 'checked', true
|
||||
$('#sub-day-container').addClass('hide')
|
||||
|
||||
if Qstorage.getItem('message')
|
||||
container = $('.alert-success');
|
||||
msg_finder = Qstorage.getItem('message');
|
||||
msg_finder = 'messages.'+msg_finder if msg_finder.indexOf('.') == -1
|
||||
container.find('div').text(t(msg_finder))
|
||||
container.show()
|
||||
Qstorage.removeItem('message')
|
||||
|
||||
setupTranslations()
|
||||
|
||||
# GOOGLE LOCATION PICKER
|
||||
$("input.location_picker").each (i)->
|
||||
#return if typeof(google) == 'undefined'
|
||||
iconBase = 'https://maps.google.com/mapfiles/kml/'
|
||||
location_input = $(this)
|
||||
map_div = $('<div>').addClass("location_picker_map")
|
||||
|
||||
location_input.before(map_div)
|
||||
#this.parentNode.insertBefore(map_div, this)
|
||||
location_input.hide()
|
||||
|
||||
lat = 52.07436798080633
|
||||
lng = 4.316811561584473
|
||||
if (this.value.split(',').length == 2)
|
||||
values = this.value.split(',')
|
||||
lat = values[0]
|
||||
lng = values[1]
|
||||
center = new google.maps.LatLng(lat,lng)
|
||||
mapOptions =
|
||||
zoom: 15
|
||||
center: center
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
||||
zoomControl: true
|
||||
zoomControlOptions:
|
||||
style: google.maps.ZoomControlStyle.SMALL
|
||||
mapTypeControl: false
|
||||
panControl: false
|
||||
scaleControl: false
|
||||
streetViewControl: false
|
||||
|
||||
map = new google.maps.Map(map_div.get(0), mapOptions)
|
||||
marker = new google.maps.Marker(
|
||||
position: center
|
||||
map: map
|
||||
title: 'Location'
|
||||
icon: '/assets/icons/maps_location.png'
|
||||
)
|
||||
google.maps.event.addListener(map, 'click', (point)->
|
||||
marker.setPosition(point.latLng)
|
||||
location_input.val point.latLng.lat() + ','+ point.latLng.lng()
|
||||
)
|
||||
|
||||
search_field = $('<input type="text">')
|
||||
search_field.addClass('location_picker_search')
|
||||
autocomplete = new google.maps.places.Autocomplete(search_field.get(0))
|
||||
autocomplete.bindTo('bounds', map)
|
||||
search_field.keypress( (e) ->
|
||||
if e.which == 13
|
||||
e.preventDefault()
|
||||
)
|
||||
window.autocomplete = autocomplete
|
||||
map_div.before(search_field)
|
||||
infowindow = new google.maps.InfoWindow()
|
||||
search_marker = new google.maps.Marker({map: map, icon: iconBase + 'shapes/placemark_circle.png'})
|
||||
google.maps.event.addListener autocomplete, 'place_changed', ->
|
||||
infowindow.close()
|
||||
search_marker.setVisible(false)
|
||||
place = autocomplete.getPlace()
|
||||
return unless place.geometry
|
||||
#if place.geometry.viewport
|
||||
# map.fitBounds(place.geometry.viewport)
|
||||
#else
|
||||
map.setCenter(place.geometry.location)
|
||||
map.setZoom(17)
|
||||
image =
|
||||
url: place.icon
|
||||
size: new google.maps.Size(71, 71)
|
||||
origin: new google.maps.Point(0, 0)
|
||||
anchor: new google.maps.Point(17, 34)
|
||||
scaledSize: new google.maps.Size(35, 35)
|
||||
#search_marker.setIcon(image)
|
||||
search_marker.setPosition(place.geometry.location)
|
||||
search_marker.setVisible(true)
|
||||
|
||||
address = ''
|
||||
if place.address_components
|
||||
address = [
|
||||
(place.address_components[0] && place.address_components[0].short_name || ''),
|
||||
(place.address_components[1] && place.address_components[1].short_name || ''),
|
||||
(place.address_components[2] && place.address_components[2].short_name || '')
|
||||
].join(' ')
|
||||
infowindow.setContent('<div><strong>' + place.name + '</strong><br>' + address + '</div>')
|
||||
infowindow.open(map, search_marker)
|
||||
# end google location map
|
||||
|
||||
$('.toggle-side-menu,.side-menu').click ->
|
||||
menu = $('aside.side-menu')
|
||||
toggle = $('.toggle-side-menu')
|
||||
if menu.is(':visible')
|
||||
menu.animate left: -255, -> $(@).hide()
|
||||
toggle.animate left: 0, -> $(@).removeClass('open')
|
||||
else
|
||||
menu.show().animate left: 0
|
||||
toggle.animate left: 222 - 30, -> $(@).addClass('open')
|
||||
Reference in New Issue
Block a user