diff --git a/addons/website_sale/static/src/snippets/s_products_searchbar/options.js b/addons/website_sale/static/src/snippets/s_products_searchbar/options.js deleted file mode 100644 index d4fa9c1e835..00000000000 --- a/addons/website_sale/static/src/snippets/s_products_searchbar/options.js +++ /dev/null @@ -1,65 +0,0 @@ -odoo.define('website_sale.s_products_searchbar_options', function (require) { -'use strict'; - -const Dialog = require('web.Dialog'); -const options = require('web_editor.snippets.options'); - -const { qweb, _t } = require('web.core'); - -options.registry.ProductsSearchBar = options.Class.extend({ - xmlDependencies: ['/website_sale/static/src/xml/website_sale.editor.xml'], - - /** - * @override - */ - start: function () { - this.$searchProductsInput = this.$('.search-query'); - this.$searchOrderField = this.$('.o_wsale_search_order_by'); - return this._super.apply(this, arguments); - }, - - //-------------------------------------------------------------------------- - // Options - //-------------------------------------------------------------------------- - - /** - * @see this.selectClass for parameters - */ - openSearchbarSettings: function (previewMode, widgetValue, params) { - var self = this; - new Dialog(this, { - title: _t("Products Search Bar"), - $content: $(qweb.render('website_sale.dialog.productsSearchBar', { - currentOrderBy: this.$searchOrderField.val(), - currentLimit: parseInt(this.$searchProductsInput.attr('data-limit')), - currentDisplayDescription: this.$searchProductsInput.attr('data-display-description') === 'true', - currentDisplayPrice: this.$searchProductsInput.attr('data-display-price') === 'true', - currentDisplayImage: this.$searchProductsInput.attr('data-display-image') === 'true', - })), - buttons: [ - { - text: _t("Save"), - classes: 'btn-primary', - click: function () { - self.$searchOrderField.attr({ - 'value': this.$('#order_by').val(), - }); - self.$searchProductsInput.attr({ - 'data-limit': this.$('#use_autocomplete').is(':checked') ? this.$('#limit').val() : 0, - 'data-display-description': this.$('#display_description').is(':checked'), - 'data-display-price': this.$('#display_price').is(':checked'), - 'data-display-image': this.$('#display_image').is(':checked'), - }); - self.$target.trigger('content_changed'); - this.close(); - }, - }, - { - text: _t("Discard"), - close: true, - }, - ], - }).open(); - }, -}); -}); diff --git a/addons/website_sale/static/src/xml/website_sale.editor.xml b/addons/website_sale/static/src/xml/website_sale.editor.xml deleted file mode 100644 index 4cc12eafb1a..00000000000 --- a/addons/website_sale/static/src/xml/website_sale.editor.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - -
-
- - -
-
-
- - -
-
-
-
- - -
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- -
diff --git a/addons/website_sale/views/snippets/s_products_searchbar.xml b/addons/website_sale/views/snippets/s_products_searchbar.xml index 7658abe64dc..5a80366b2c9 100644 --- a/addons/website_sale/views/snippets/s_products_searchbar.xml +++ b/addons/website_sale/views/snippets/s_products_searchbar.xml @@ -26,9 +26,23 @@