app/assets/javascripts/medivo/models.coffee in medivo-0.0.2 vs app/assets/javascripts/medivo/models.coffee in medivo-0.0.3

- old
+ new

@@ -25,14 +25,15 @@ this.address.replace(/(\s*,\s*$)/g, "").titleize() ) ########## Lab model ############## class window.Lab - constructor: (@data)-> marker: null map_tooltip_template: Handlebars.compile("{{titleize name}}\n{{address_without_comma address}}\n{{titleize city}},{{state}} ") + constructor: (@data)-> + clearMarker: -> if this.marker this.marker.setMap(null) this.marker = null @@ -53,13 +54,18 @@ makeIcon: -> new google.maps.MarkerImage("/assets/medivo/lab.png") ########## LabList model ############## class window.LabList + show_number: 3 - constructor: (lab_info)-> + constructor: (lab_info, show_number)-> @labs = [] + @show_number = show_number if show_number + console.log(@show_number) this.setLabs(lab_info) + + getLabs: -> @labs.slice(0, @show_number) setLabs: (lab_info)-> this.clearMarkers() labs = @labs = [] $.each( lab_info, (index, lab_data)->