Sha256: 9421c43bc0099a124ebcd8e8b3ef058820481398b277680a8d8733b3a63e741d

Contents?: true

Size: 650 Bytes

Versions: 8

Compression:

Stored size: 650 Bytes

Contents

# make things editable that can be edited

# $('.editable').editable(
  # success: (response, value) ->
    # element = $(this)
    # css = element.data('classes') || {}
    # element.removeClass(class_name) for key, class_name of css
    # element.addClass(css[value])
    # element.css('background-color', '')
# )

# swap CSS classes when the value changes

jQuery ($) ->
  $("[data-classes]").on "save", (e, data) ->
    value = data.newValue
    element = $(this)
    css = element.data('classes') || {}
    element.removeClass(class_name) for key, class_name of css
    element.addClass(css[value])
    element.css('background-color', '')
    

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
x-editable-rails-bs4-1.5.5.2 vendor/assets/javascripts/editable/rails/data_classes.js.coffee
x-editable-rails-1.5.5.1 vendor/assets/javascripts/editable/rails/data_classes.js.coffee
x-editable-rails-1.5.5 vendor/assets/javascripts/editable/rails/data_classes.js.coffee
x-editable-rails-1.5.4 vendor/assets/javascripts/editable/rails/data_classes.js.coffee
x-editable-rails-1.5.3 vendor/assets/javascripts/editable/rails/data_classes.js.coffee
x-editable-rails-1.5.2 vendor/assets/javascripts/editable/rails/data_classes.js.coffee
x-editable-rails-1.5.1 vendor/assets/javascripts/editable/rails/data_classes.js.coffee
x-editable-rails-1.5.0 vendor/assets/javascripts/editable/rails/data_classes.js.coffee