Sha256: eb317ce9f8a3ded093774960a5add88c5d2007cc6be5f906eddacd7cb1ada07a

Contents?: true

Size: 520 Bytes

Versions: 82

Compression:

Stored size: 520 Bytes

Contents

$(document).on "turbolinks:load", ->
  $("select").map ->
    select = $(this)
    form   = select.parents("form")

    return if select.find("[value=custom_date]").length == 0

    select.change ->
      if select.val() == "custom_date"
        form.find(".form-group[class*=date_begin], .form-group[class*=date_end]").show()
      else
        form.find("input[id*=date_begin], input[id*=date_end]").val("")
        form.find(".form-group[class*=date_begin], .form-group[class*=date_end]").hide()

    select.change()

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
agilibox-1.5.8 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.5.7 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.5.6 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.5.5 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.5.4 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.5.3 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.5.2 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.5.1 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.5.0 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.4.4 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.4.3 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.4.2 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.4.1 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.4.0 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.3.6 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.3.5 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.3.4 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.3.3 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.3.2 app/assets/javascripts/agilibox/filters_date.coffee
agilibox-1.3.1 app/assets/javascripts/agilibox/filters_date.coffee