From a754a77bd84ad678209c78179a6f62dbda69b46e Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 22 Aug 2018 15:11:37 +0200 Subject: [PATCH] [FIX] web: restore odooBounce once again The odooBounce (previously openerpBounce) function has been fixed many times over the years. Each time breaking the layout a different way after the backend was redesigned. It is time for the proper fix: no more JS animation relying on jQuery, instead: a CSS animation. Let's try a bouncing outline instead of a bouncing button for a change. --- addons/web/static/src/js/libs/jquery.js | 7 +++++-- addons/web/static/src/scss/ui.scss | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/libs/jquery.js b/addons/web/static/src/js/libs/jquery.js index 4bcab8eb866..77aa9e63c3d 100644 --- a/addons/web/static/src/js/libs/jquery.js +++ b/addons/web/static/src/js/libs/jquery.js @@ -92,8 +92,11 @@ $.fn.extend({ */ odooBounce: function () { return this.each(function () { - $(this).css('box-sizing', 'content-box') - .effect('bounce', {distance: 18, times: 5}, 250); + var $el = $(this); + $el.addClass('o_catch_attention'); + setTimeout(function () { + $el.removeClass('o_catch_attention'); + }, 400); }); }, /** diff --git a/addons/web/static/src/scss/ui.scss b/addons/web/static/src/scss/ui.scss index efdba4bc420..b2f4a147ca1 100644 --- a/addons/web/static/src/scss/ui.scss +++ b/addons/web/static/src/scss/ui.scss @@ -55,3 +55,18 @@ } } } + +.o_catch_attention { + position: relative; + z-index: 1; + animation: catchAttention 200ms ease 0s infinite normal; +} + +@keyframes catchAttention { + 0% { + outline: 0px solid fade-out($o-brand-primary, 0.0); + } + 100% { + outline: 20px solid fade-out($o-brand-primary, 1.0); + } +}