summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/abstract_web_client.js
diff options
context:
space:
mode:
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;