Skip to content
Snippets Groups Projects
Commit fb005684 authored by qsm-odoo's avatar qsm-odoo
Browse files

[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: https://github.com/odoo/odoo/commit/b7f2dd4d56537fb06682419fa75fb7c671160243
parent 9ec5a4c0
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment