diff options
Diffstat (limited to 'addons/website_sale/static/src/js/website_sale.editor.js')
| -rw-r--r-- | addons/website_sale/static/src/js/website_sale.editor.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/addons/website_sale/static/src/js/website_sale.editor.js b/addons/website_sale/static/src/js/website_sale.editor.js index e4f271604b5..84acbbc1008 100644 --- a/addons/website_sale/static/src/js/website_sale.editor.js +++ b/addons/website_sale/static/src/js/website_sale.editor.js @@ -392,4 +392,50 @@ options.registry.ProductsSearchBar = options.Class.extend({ }).open(); }, }); + +/** + * Handles the edition of products search bar snippet. + */ +options.registry.ProductsRecentlyViewed = options.Class.extend({ + xmlDependencies: ['/website_sale/static/src/xml/website_sale_recently_viewed.xml'], + + /** + * @override + */ + start: function () { + var carouselOptions = { + productsGroups: [[{ + id: 0, + website_url: '#', + display_name: 'Product 1', + price: '$ <span class="oe_currency_value">750.00</span>', + }, { + id: 0, + website_url: '#', + display_name: 'Product 2', + price: '$ <span class="oe_currency_value">750.00</span>', + }, { + id: 0, + website_url: '#', + display_name: 'Product 3', + price: '$ <span class="oe_currency_value">750.00</span>', + }, { + id: 0, + website_url: '#', + display_name: 'Product 4', + price: '$ <span class="oe_currency_value">750.00</span>', + }]], + uniqueId: 1, + productFrame: 4 + }; + this.$target.find('.slider').html($(qweb.render('website_sale.productsRecentlyViewed', carouselOptions))).fadeIn(); + return this._super.apply(this, arguments); + }, + /** + * @override + */ + cleanForSave: function () { + this.$target.find('.slider').html('').css('display', 'none'); + }, +}); }); |
