if (typeof Drupal !== "undefined" && typeof Drupal.Ajax !== "undefined" && typeof Drupal.Ajax.prototype.beforeSubmitCVOriginal === "undefined") {
Drupal.Ajax.prototype.beforeSubmitCVOriginal = Drupal.Ajax.prototype.beforeSubmit;
Drupal.Ajax.prototype.beforeSubmit = function (form_values, element_settings, options) {
if (options.data._triggering_element_name === "op") {
if (typeof this.$form !== "undefined") {
// $(this.$form).validate(drupalSettings.cvJqueryValidateOptions);
if (this.$form.valid()) {
// console.log("ФОРМА ВАЛИДНА");
} else {
// console.log("ФОРМА НЕ ВАЛИДНА");
this.ajaxing = false;
return false;
}
}
}
return this.beforeSubmitCVOriginal(form_values, element_settings, options);
};
}