Sha256: 5f095bac69e0ac67685d0412cee6e698002680f137889efa4053f0011351ee7a

Contents?: true

Size: 1.11 KB

Versions: 30

Compression:

Stored size: 1.11 KB

Contents

$(document).ready ->

  ###### 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.setList(data.labs)
      # set the first lab as selected
      $('input:radio[name=selected_lab]:first').prop('checked',true)
      $('form#lab_data_search input[type=submit]').prop("disabled", false)
    )
    .bind('ajax:complete', (event, data)->
    )

  ###### handle toggle to show more labs ########
  $("#more_labs_list_toggler").live("click", ->
    window.lab_list.setShowNumber(window.max_lab_show_number)
    # set the first lab as selected
    $('input:radio[name=selected_lab]:first').prop('checked',true)
    # hide the toggle to show more after they have been shown
    $("#more_labs_list_toggler").hide()
  )

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
medivo-0.1.13 app/assets/javascripts/medivo/lab_list/handlers.coffee
medivo-0.1.12 app/assets/javascripts/medivo/lab_list/handlers.coffee
medivo-0.1.11 app/assets/javascripts/medivo/lab_list/handlers.coffee
medivo-0.1.10 app/assets/javascripts/medivo/lab_list/handlers.coffee
medivo-0.1.9 app/assets/javascripts/medivo/lab_list/handlers.coffee
medivo-0.1.8 app/assets/javascripts/medivo/lab_list/handlers.coffee
medivo-0.1.7 app/assets/javascripts/medivo/lab_list/handlers.coffee
medivo-0.1.6 app/assets/javascripts/medivo/lab_list/handlers.coffee
medivo-0.1.5 app/assets/javascripts/medivo/lab_list/handlers.coffee
medivo-0.1.4 app/assets/javascripts/medivo/lab_list/handlers.coffee