Sha256: 28c68d68b4f25e8ef2f5af554aa1fc22b5b81f7e7de4c882ff750bfe5947df42
Contents?: true
Size: 711 Bytes
Versions: 21
Compression:
Stored size: 711 Bytes
Contents
$(document).ready(function() { $checkboxes = $('[data-boarded-bus]'); if ($checkboxes.length < 1) { return; } $checkboxes.on('change', function() { $checkbox = $(this); var checked = $checkbox.is(':checked'); $.ajax({ url: $checkbox.data('action'), type: 'PATCH', data: { questionnaire: { boarded_bus: checked, id: $checkbox.data('id'), } } }).done(function() { $checkbox.prop('checked', checked); }).fail(function() { alert("Request failed, please refresh the page or try again later."); }).always(function() { $('[type=submit][data-bulk-row-edit]').prop('disabled', false); }); }); });
Version data entries
21 entries across 21 versions & 1 rubygems