Sha256: 4c1c9f518e501437ee39e2212ddf8b847ee807a8f2d0b8e7428f11992dadc5e2
Contents?: true
Size: 1.49 KB
Versions: 14
Compression:
Stored size: 1.49 KB
Contents
onDOMReady = -> # # Use ActiveAdmin.modal_dialog to prompt user if confirmation is required for current Batch Action # $('.batch_actions_selector li a').click (e)-> e.stopPropagation() # prevent Rails UJS click event e.preventDefault() if message = $(@).data 'confirm' ActiveAdmin.modal_dialog message, $(@).data('inputs'), (inputs)=> $(@).trigger 'confirm:complete', inputs else $(@).trigger 'confirm:complete' $('.batch_actions_selector li a').on 'confirm:complete', (e, inputs)-> if val = JSON.stringify inputs $('#batch_action_inputs').removeAttr('disabled').val val else $('#batch_action_inputs').attr 'disabled', 'disabled' $('#batch_action').val $(@).data 'action' $('#collection_selection').submit() # # Add checkbox selection to resource tables and lists if batch actions are enabled # if $(".batch_actions_selector").length && $(":checkbox.toggle_all").length if $(".paginated_collection table.index_table").length $(".paginated_collection table.index_table").tableCheckboxToggler() else $(".paginated_collection").checkboxToggler() $(document).on 'change', '.paginated_collection :checkbox', -> if $(".paginated_collection :checkbox:checked").length $(".batch_actions_selector").each -> $(@).aaDropdownMenu("enable") else $(".batch_actions_selector").each -> $(@).aaDropdownMenu("disable") $(document). ready(onDOMReady). on 'page:load turbolinks:load', onDOMReady
Version data entries
14 entries across 14 versions & 2 rubygems