Sha256: 0363c142edcfc1780a603a352d76129eb355db0c27f5c635de1511ff66278618
Contents?: true
Size: 637 Bytes
Versions: 10
Compression:
Stored size: 637 Bytes
Contents
class @AssetReplacer constructor: (element, options={}) -> @element = $(element) @input = @element.find('.js-replace-asset') @form = @element.find('form') @btn = @input.prev() @actions = @element.find('.media-actions') @bindEvents() bindEvents: () => @input.on('change', @change) @element.on('mouseover', @toggleActions) @element.on('mouseout', @toggleActions) change: (e) => @form.submit() @btn.html("<i class='fa fa-spinner fa-spin'></i> Uploading...") toggleActions: (e) => @actions.toggle() jQuery -> $('.js-media-editable').each (index, el) -> new AssetReplacer(el)
Version data entries
10 entries across 10 versions & 1 rubygems