Rename jQuery Serialize Object function to prevent conflicts [MAILPOET-1190]
This commit is contained in:
@@ -44,7 +44,7 @@ define(
|
||||
this.loadItem(this.props.params.id);
|
||||
} else {
|
||||
this.setState({
|
||||
item: jQuery('.mailpoet_form').serializeObject(),
|
||||
item: jQuery('.mailpoet_form').mailpoetSerializeObject(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -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)
|
||||
});
|
||||
|
@@ -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 };
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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({
|
||||
|
Reference in New Issue
Block a user