Sha256: 0ff5289c2a8a23555fe976ae1ddda74655c56638af2af3f542bcb80127141780

Contents?: true

Size: 882 Bytes

Versions: 4

Compression:

Stored size: 882 Bytes

Contents

$(document).ready ->

  ####### init empty lab list and the views #########
  window.lab_list = new window.OrderedLabList( [] )
  window.map_view = new window.MapView( lab_list )
  window.lab_list_view = new window.LabListView( lab_list )

  ###### handle ajax lab data search ########
  $("form#lab_data_search")
    .bind('ajax:beforeSend', (event, data)->
      zip_code = $(this).find('#zip_code').val()
      if (!zip_code.match(/\d{5}/))
        span = $('<span>Zip code should be 5 digits</span>')
        $('form#lab_data_search .error_message').append(span)
        span.fadeOut(4000)
        false
    )
    .bind('ajax:success', (event, data)->
      window.map_view.center_point = data.zip_location
      window.lab_list.setLabs(data.labs)
      $('form#lab_data_search input[type=submit]').prop("disabled", false)
    )
    .bind('ajax:complete', (event, data)->
    )

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
medivo-0.0.12 app/assets/javascripts/medivo/lab_list/init.coffee
medivo-0.0.11 app/assets/javascripts/medivo/lab_list/init.coffee
medivo-0.0.9 app/assets/javascripts/medivo/lab_list/init.coffee
medivo-0.0.8 app/assets/javascripts/medivo/lab_list/init.coffee