more generic js
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
*/
|
*/
|
||||||
Drupal.ajax.prototype.commands.bookingAjaxCheckboxes = function(ajax, response, status) {
|
Drupal.ajax.prototype.commands.bookingAjaxCheckboxes = function(ajax, response, status) {
|
||||||
jQuery(function($) {
|
jQuery(function($) {
|
||||||
var arr = $.parseJSON($('input#booking_email_default_ids').val())
|
var arr = $.parseJSON($('input#' + response.formDataElement).val())
|
||||||
$('#booking-manual-email-form').find(':checkbox[name^="' + response.checkboxName + '"]').each(function () {
|
$('#' + response.formName).find(':checkbox[name^="' + response.checkboxName + '"]').each(function () {
|
||||||
//.prop() doesn't exist in Drupal's old version of jQuery so use .attr() instead
|
//.prop() doesn't exist in Drupal's old version of jQuery so use .attr() instead
|
||||||
$(this).attr("checked", ($.inArray($(this).val(), arr) != -1));
|
$(this).attr("checked", ($.inArray($(this).val(), arr) != -1));
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user