Files
booking/booking.js
Nathan Coad fd084499b4 add test
2016-06-03 11:17:32 +10:00

12 lines
534 B
JavaScript

/**
* Special Effects AJAX framework command.
*/
Drupal.ajax.prototype.commands.bookingEmailIDs = function(ajax, response, status) {
jQuery(function($) {
var arr = $.parseJSON($('input#booking_email_default_ids').val())
$('#booking-manual-email-form').find(':checkbox[name^="table"]').each(function () {
//.prop() doesn't exist in Drupal's old version of jQuery so use .attr() instead
$(this).attr("checked", ($.inArray($(this).val(), arr) != -1));
});
});
}