Sha256: b4d56ea34af1b2ab5bd512394a52bd80f7cfa6121744a0c499a8e66d3c2db783
Contents?: true
Size: 990 Bytes
Versions: 1
Compression:
Stored size: 990 Bytes
Contents
$ -> if $('#list')[0] $("#list input.toggle").live "click", -> checked = $(this).is(":checked") $("#list [name='ids[]']").attr "checked", checked $('#list tbody tr').toggleClass('active_row', checked) $("#list tbody input").live "click", -> $(this).closest('tr').toggleClass('active_row') submitBatch = (el) -> if $("#list [name='ids[]']:checked")[0] $el = $(el) action = $el.data('action') $('#batch_action').val(action) $('#batch_action_form').submit() $('#list tbody tr').live 'click', (e) -> return true unless _.include(['TR', 'TD'], e.target.tagName) e.preventDefault() e.stopPropagation() $el = $(this) $el.closest('tr').toggleClass('active_row') $el.find('td:first input').attr 'checked', (i, v) -> !v $('.batch_action_link').live click: (e) -> e.preventDefault() submitBatch(this) 'confirm:success': -> submitBatch(this)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ab_admin-0.1.0 | app/assets/javascripts/ab_admin/core/batch_actions.js.coffee |