diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-06-07 08:28:00 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-06-07 09:25:48 +0200 |
| commit | 5aa1cf189039f4bbfdb5f6f66a1c1604c8bb243b (patch) | |
| tree | 19eaf4afade99337d4a76aa0005dba462db2ea4a /addons/web/static/src/js/chrome/abstract_web_client.js | |
| parent | cb9a8bdc79ef6bd6a9fbd43afc73e14825bc3923 (diff) | |
[FIX] web: re-introduce wow effect
When clicking on buttons with classname o_wow (e.g. when marking
an opportunity as won).
Diffstat (limited to 'addons/web/static/src/js/chrome/abstract_web_client.js')
| -rw-r--r-- | addons/web/static/src/js/chrome/abstract_web_client.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/addons/web/static/src/js/chrome/abstract_web_client.js b/addons/web/static/src/js/chrome/abstract_web_client.js index 155690f9663..9efb2a3c937 100644 --- a/addons/web/static/src/js/chrome/abstract_web_client.js +++ b/addons/web/static/src/js/chrome/abstract_web_client.js @@ -81,6 +81,7 @@ var AbstractWebClient = Widget.extend(mixins.ServiceProvider, { } }); }, + show_wow: '_onShowWow', }, init: function (parent) { this.client_options = {}; @@ -313,6 +314,22 @@ var AbstractWebClient = Widget.extend(mixins.ServiceProvider, { this.notification_manager.warn(e.data.title, e.data.message, e.data.sticky); } }, + /** + * Displays a thumb up, heart or peace image (randomly) for a moment (e.g. + * used when an opportunity is won) + * + * @private + */ + _onShowWow: function () { + var className = 'o_wow_thumbs'; + if (Math.random() > 0.9) { + var otherClasses = ['o_wow_peace', 'o_wow_heart']; + className = otherClasses[Math.floor(Math.random()*otherClasses.length)]; + } + var $body = $('body'); + $body.addClass(className); + setTimeout($body.removeClass.bind($body, className), 1000); + }, }); return AbstractWebClient; |
