[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user