From f9b7104f7cdb3fda2de700bc28f83cfa1f737278 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Tue, 28 Aug 2018 18:34:59 +0200 Subject: [PATCH] [FIX] website_sale_comparison: bs4 fix, don't display compare box if nothing to compare --- .../static/src/js/website_sale_comparison.js | 12 ++++++------ .../static/src/xml/comparison.xml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/website_sale_comparison/static/src/js/website_sale_comparison.js b/addons/website_sale_comparison/static/src/js/website_sale_comparison.js index a4d25cf2dcc..40d750da293 100644 --- a/addons/website_sale_comparison/static/src/js/website_sale_comparison.js +++ b/addons/website_sale_comparison/static/src/js/website_sale_comparison.js @@ -35,7 +35,7 @@ var ProductComparison = Widget.extend({ self._loadProducts(this.comparelist_product_ids).then(function () { self._updateContent(self.comparelist_product_ids, true); if (self.comparelist_product_ids.length) { - $('.o_product_feature_panel').show(); + $('.o_product_feature_panel').addClass('d-md-block'); self._updateComparelistView(); } }); @@ -136,7 +136,7 @@ var ProductComparison = Widget.extend({ */ _addNewProducts: function (product_id) { var self = this; - $('.o_product_feature_panel').show(); + $('.o_product_feature_panel').addClass('d-md-block'); if (!_.contains(self.comparelist_product_ids, product_id)) { self.comparelist_product_ids.push(product_id); if (_.has(self.product_data, product_id)){ @@ -188,14 +188,14 @@ var ProductComparison = Widget.extend({ */ _updateComparelistView: function () { this.$('.o_product_circle').text(this.comparelist_product_ids.length); - this.$('.o_comparelist_button').hide(); + this.$('.o_comparelist_button').removeClass('d-md-block'); if (_.isEmpty(this.comparelist_product_ids)) { - $('.o_product_feature_panel').hide(); + $('.o_product_feature_panel').removeClass('d-md-block'); this._togglePanel(); } else { - this.$('.o_comparelist_products').show(); + this.$('.o_comparelist_products').addClass('d-md-block'); if (this.comparelist_product_ids.length >=2) { - this.$('.o_comparelist_button').show(); + this.$('.o_comparelist_button').addClass('d-md-block'); this.$('.o_comparelist_button a').attr('href', '/shop/compare/?products='+this.comparelist_product_ids.toString()); } } diff --git a/addons/website_sale_comparison/static/src/xml/comparison.xml b/addons/website_sale_comparison/static/src/xml/comparison.xml index 98d3a2e55ce..f3eca962374 100644 --- a/addons/website_sale_comparison/static/src/xml/comparison.xml +++ b/addons/website_sale_comparison/static/src/xml/comparison.xml @@ -1,7 +1,7 @@ -