diff options
| author | Benjamin Vray <bvr@odoo.com> | 2019-11-06 15:01:07 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-03-31 18:16:08 +0000 |
| commit | 3defe35a0e4e2097115633797df6898ac2724c66 (patch) | |
| tree | f20fb822b258fde0fefa59045889944d6f5dba6d /addons/website_sale/static | |
| parent | 5ba817c453270fa8366397f9767d79072054df20 (diff) | |
[IMP] website, *: add and review header visibility options
*: portal
Adding a choice of several header behaviors (fixed, fade out with
scroll, etc.). Review the way those animations works in mobile/desktop
and now perform them without duplicating the header DOM element.
Also allow to hide of adapt the size of the logo when the page is
scrolled.
Part of https://github.com/odoo/odoo/pull/38950
task-2087641
Co-authored-by: qsm-odoo <qsm@odoo.com>
Diffstat (limited to 'addons/website_sale/static')
| -rw-r--r-- | addons/website_sale/static/src/js/website_sale_recently_viewed.js | 2 | ||||
| -rw-r--r-- | addons/website_sale/static/src/js/website_sale_utils.js | 19 |
2 files changed, 1 insertions, 20 deletions
diff --git a/addons/website_sale/static/src/js/website_sale_recently_viewed.js b/addons/website_sale/static/src/js/website_sale_recently_viewed.js index 774e747eaa6..ea9fedec840 100644 --- a/addons/website_sale/static/src/js/website_sale_recently_viewed.js +++ b/addons/website_sale/static/src/js/website_sale_recently_viewed.js @@ -150,7 +150,7 @@ publicWidget.registry.productsRecentlyViewedSnippet = publicWidget.Widget.extend }, }).then(function (data) { wSaleUtils.updateCartNavBar(data); - var $navButton = wSaleUtils.getNavBarButton('.o_wsale_my_cart'); + var $navButton = $('header .o_wsale_my_cart').first(); var fetch = self._fetch(); var animation = wSaleUtils.animateClone($navButton, $(ev.currentTarget).parents('.o_carousel_product_card'), 25, 40); Promise.all([fetch, animation]).then(function (values) { diff --git a/addons/website_sale/static/src/js/website_sale_utils.js b/addons/website_sale/static/src/js/website_sale_utils.js index 2c30cd8b3b6..52c3e448d52 100644 --- a/addons/website_sale/static/src/js/website_sale_utils.js +++ b/addons/website_sale/static/src/js/website_sale_utils.js @@ -1,24 +1,6 @@ odoo.define('website_sale.utils', function (require) { 'use strict'; -/** - * Gets the element in the navbar currently displayed. - * Depending on the scroll position, it could either be the one in the main - * top bar or the one in the affixed navbar. - * - * @private - * @param {string} selector - * @returns {jQuery} - */ -function getNavBarButton(selector) { - var $affixedHeaderButton = $('header.affixed ' + selector); - if ($affixedHeaderButton.length) { - return $affixedHeaderButton; - } else { - return $('header ' + selector).first(); - } -} - function animateClone($cart, $elem, offsetTop, offsetLeft) { $cart.find('.o_animate_blink').addClass('o_red_highlight o_shadow_animation').delay(500).queue(function () { $(this).removeClass("o_shadow_animation").dequeue(); @@ -72,7 +54,6 @@ function updateCartNavBar(data) { return { animateClone: animateClone, - getNavBarButton: getNavBarButton, updateCartNavBar: updateCartNavBar, }; }); |
