[FIX] website_sale_comparison: fix compare animate

The animation was not waiting for the target to be displayed.

Part of https://github.com/odoo/odoo/pull/37132

task-2070507

X-original-commit: fb00568464e8d2a39975c373016616a2970aa501
This commit is contained in:
qsm-odoo
2019-10-14 15:06:21 +00:00
committed by fw-bot
parent 842ce44d61
commit a6507f0fa9
@@ -106,18 +106,17 @@ var ProductComparison = publicWidget.Widget.extend(VariantMixin, {
false
).then(function (productId) {
productId = parseInt(productId, 10);
if (!productId) {
return;
}
self._addNewProducts(productId);
website_sale_utils.animateClone(
$('#comparelist .o_product_panel_header'),
$elem.closest('form'),
-50,
10
);
self._addNewProducts(productId).then(function () {
website_sale_utils.animateClone(
$('#comparelist .o_product_panel_header'),
$elem.closest('form'),
-50,
10
);
});
});
} else {
this.$('.o_comparelist_limit_warning').show();
@@ -158,7 +157,7 @@ var ProductComparison = publicWidget.Widget.extend(VariantMixin, {
* @private
*/
_addNewProducts: function (product_id) {
this.guard.exec(this._addNewProductsImpl.bind(this, product_id));
return this.guard.exec(this._addNewProductsImpl.bind(this, product_id));
},
_addNewProductsImpl: function (product_id) {
var self = this;