[REF] portal: adapt code after jQuery update
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
This commit is contained in:
committed by
Aaron Bohy
co-authored by
Aaron Bohy
Christophe Matthieu
Mathieu Duckerts-Antoine
David Monjoie
Martin Geubelle
svs-odoo
parent
53285f1a76
commit
f414c9f3f8
@@ -34,7 +34,7 @@ publicWidget.registry.portalDetails = publicWidget.Widget.extend({
|
||||
var countryID = ($country.val() || 0);
|
||||
this.$stateOptions.detach();
|
||||
var $displayedState = this.$stateOptions.filter('[data-country_id=' + countryID + ']');
|
||||
var nb = $displayedState.appendTo(this.$state).show().size();
|
||||
var nb = $displayedState.appendTo(this.$state).show().length;
|
||||
this.$state.parent().toggle(nb >= 1);
|
||||
},
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ var PortalComposer = publicWidget.Widget.extend({
|
||||
* @private
|
||||
*/
|
||||
_onSubmitButtonClick: function () {
|
||||
return $.Deferred();
|
||||
return new Promise(function() {});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -102,10 +102,10 @@ var PortalChatter = publicWidget.Widget.extend({
|
||||
* @override
|
||||
*/
|
||||
willStart: function () {
|
||||
return $.when(
|
||||
return Promise.all([
|
||||
this._super.apply(this, arguments),
|
||||
this._chatterInit()
|
||||
);
|
||||
]);
|
||||
},
|
||||
/**
|
||||
* @override
|
||||
@@ -133,7 +133,7 @@ var PortalChatter = publicWidget.Widget.extend({
|
||||
defs.push(this._composer.replace(this.$('.o_portal_chatter_composer')));
|
||||
}
|
||||
|
||||
return $.when.apply($, defs);
|
||||
return Promise.all(defs);
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -145,7 +145,7 @@ var PortalChatter = publicWidget.Widget.extend({
|
||||
* current page and current domain.
|
||||
*
|
||||
* @param {Array} domain
|
||||
* @returns {Deferred}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
messageFetch: function (domain) {
|
||||
var self = this;
|
||||
@@ -307,7 +307,7 @@ publicWidget.registry.portalChatter = publicWidget.Widget.extend({
|
||||
var defs = [this._super.apply(this, arguments)];
|
||||
var chatter = new PortalChatter(this, this.$el.data());
|
||||
defs.push(chatter.appendTo(this.$el));
|
||||
return $.when.apply($, defs);
|
||||
return Promise.all(defs);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ var SignatureForm = publicWidget.Widget.extend({
|
||||
window.location.reload();
|
||||
}
|
||||
// no resolve if we reload the page
|
||||
return $.Deferred();
|
||||
return new Promise(function () { });
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -180,10 +180,10 @@ publicWidget.registry.SignatureForm = publicWidget.Widget.extend({
|
||||
}
|
||||
});
|
||||
|
||||
return $.when(
|
||||
return Promise.all([
|
||||
this._super.apply(this, arguments),
|
||||
form.appendTo(this.$el)
|
||||
);
|
||||
]);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user