Sha256: 6243b06f717324e90edfaea6e9f442b21a337777eb3cbb7d491a12d9efa3c1c5
Contents?: true
Size: 862 Bytes
Versions: 39
Compression:
Stored size: 862 Bytes
Contents
jQuery.fn.extend autosave: -> slot = @slot() return if @attr 'no-autosave' multi = @closest '.form-group' if multi[0] return unless id = multi.data 'cardId' reportee = ': ' + multi.data 'cardName' else id = slot.data 'cardId' reportee = '' return unless id # might be better to put this href base in the html submit_url = decko.path 'update/~' + id form_data = $('#edit_card_'+id).serializeArray().reduce( ((obj, item) -> obj[item.name] = item.value return obj ), { 'draft' : 'true', 'success[view]' : 'blank'}); $.ajax submit_url, { data : form_data, type : 'POST' } ##{ 'card[content]' : @val() }, $(window).ready -> $('body').on 'change', '.autosave .d0-card-content', -> content_field = $(this) setTimeout ( -> content_field.autosave() ), 500
Version data entries
39 entries across 39 versions & 3 rubygems