Sha256: 4912bcafa4c9dd0db8bf3a59ec0845111e038fcde1def6a26aa04cc2400f69f2

Contents?: true

Size: 766 Bytes

Versions: 6

Compression:

Stored size: 766 Bytes

Contents

# Settings
$ ->
  show_update_btn = (el) ->
    $(el).closest('tr').find('.update_link').show()

  hide_update_btn = (el) ->
    $(el).closest('tr').find('.update_link').hide()

  $('#settings .form form input, textarea').change ->
    show_update_btn(this)

  $('#settings .form form input, textarea').keypress ->
    show_update_btn(this)

  $('#settings .form form').submit ->
    false

  $('#settings .update_link').hide()
  
  $('#settings .update_link').click (e) ->
    e.preventDefault()
    btn = $(this)
    tr  = $(btn.attr("data-id"))

    form = tr.find(".form form")
    form.ajaxSubmit
      success: (value) =>
        if form.parent().hasClass("file")
          form.find(".inline-hints").html(value)
          form.clearForm()
        btn.hide()

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activeadmin-settings-0.2.6 vendor/assets/javascripts/activeadmin_settings/settings.js.coffee
activeadmin-settings-0.2.5 vendor/assets/javascripts/activeadmin_settings/settings.js.coffee
activeadmin-settings-0.2.4 vendor/assets/javascripts/activeadmin_settings/settings.js.coffee
activeadmin-settings-0.2.3 vendor/assets/javascripts/activeadmin_settings/settings.js.coffee
activeadmin-settings-0.2.2 vendor/assets/javascripts/activeadmin_settings/settings.js.coffee
activeadmin-settings-0.2.1 vendor/assets/javascripts/activeadmin_settings/settings.js.coffee