Sha256: 386b8dd10be5de1ac0b6ac0e0b102e2b4e9444f523bdc6d0d0d963b2ac7e0a56
Contents?: true
Size: 777 Bytes
Versions: 11
Compression:
Stored size: 777 Bytes
Contents
(($) -> window.crm ||= {} crm.init_sortables = -> $('[data-sortable]').each -> $el = $(this) checkEmpty = -> $el.children('.empty').toggle($el.sortable('toArray').length is 1) $el.sortable( forcePlaceholderSize: true connectWith: $el.data('sortable-connect-with') handle: $el.data('sortable-handle') create: checkEmpty update: -> ids = [] for dom_id in $el.sortable('toArray') ids.push dom_id.replace(/[^\d]/g, '') data = {} data[$el.attr('id')] = ids $.post($el.attr('data-sortable'), data) checkEmpty() ) $(document).ready -> crm.init_sortables() $(document).ajaxComplete -> crm.init_sortables() ) jQuery
Version data entries
11 entries across 11 versions & 2 rubygems