summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/abstract_web_client.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-06-09 17:11:47 +0200
committerChristophe Simonis <chs@odoo.com>2017-06-09 17:11:47 +0200
commitab02bf34b0c1d3fa3752ca1f50b098d04dc5b137 (patch)
treea29591cae8777390cbeb35d65e23c9f8ae143135 /addons/web/static/src/js/chrome/abstract_web_client.js
parentb350c29e44b4ed1df0c428308c396771b22d73e8 (diff)
parentcc38b93ab2a6daf9c5badbc387cff20d1a01ddee (diff)
[MERGE] forward port branch saas-16 up to cc38b93ab2a
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.js17
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 9f56cd01ef4..481e9a7fc54 100644
--- a/addons/web/static/src/js/chrome/abstract_web_client.js
+++ b/addons/web/static/src/js/chrome/abstract_web_client.js
@@ -82,6 +82,7 @@ var AbstractWebClient = Widget.extend(mixins.ServiceProvider, {
}
});
},
+ show_wow: '_onShowWow',
},
init: function (parent) {
this.client_options = {};
@@ -319,6 +320,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;