Rename jQuery Serialize Object function to prevent conflicts [MAILPOET-1190]

This commit is contained in:
stoletniy
2017-10-30 22:49:00 +03:00
parent 6e45892118
commit b648852ef5
8 changed files with 8 additions and 8 deletions

View File

@@ -44,7 +44,7 @@ define(
this.loadItem(this.props.params.id);
} else {
this.setState({
item: jQuery('.mailpoet_form').serializeObject(),
item: jQuery('.mailpoet_form').mailpoetSerializeObject(),
});
}
}

View File

@@ -1060,7 +1060,7 @@ WysijaForm.Widget = window.Class.create(WysijaForm.Block, {
template: window.jQuery('#form_template_field_settings').html(),
data: this.getData(),
onSuccess: function () {
var data = window.jQuery('#form_field_settings').serializeObject();
var data = window.jQuery('#form_field_settings').mailpoetSerializeObject();
this.redraw(data);
}.bind(this)
});

View File

@@ -23,7 +23,7 @@ define(
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
$.fn.serializeObject = function (coerce) {
$.fn.mailpoetSerializeObject = function (coerce) {
var obj = {};
var coerce_types = { true: !0, false: !1, null: null };

View File

@@ -30,7 +30,7 @@ function (
});
form.parsley().on('form:submit', function (parsley) {
var form_data = form.serializeObject() || {};
var form_data = form.mailpoetSerializeObject() || {};
// check if we're on the same domain
if (isSameDomain(window.MailPoetForm.ajax_url) === false) {
// non ajax post request

View File

@@ -771,7 +771,7 @@ define(
});
jQuery('#form_field_new').parsley().on('form:submit', function () {
// get data
var data = jQuery(this.$element).serializeObject();
var data = jQuery(this.$element).mailpoetSerializeObject();
// save custom field
MailPoet.Ajax.post({