summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome.js
diff options
context:
space:
mode:
authorHitesh Trivedi <htr@openerp.com>2014-12-18 14:47:49 +0530
committerRichard Mathot <rim@odoo.com>2015-02-20 16:45:48 +0100
commit4cdc19198ee540299f69b76d5b183464d3ee3579 (patch)
treec6a46cb0c4f06a92f4bd116f224ad95861763f8f /addons/web/static/src/js/chrome.js
parent069e2be87d8250d364711b01912f34b7261ea0ba (diff)
[IMP] web: cleaner indicator when connection get lost
Diffstat (limited to 'addons/web/static/src/js/chrome.js')
-rw-r--r--addons/web/static/src/js/chrome.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index 3ef2dc5d433..8eabafb5f2d 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -252,6 +252,22 @@ instance.web.CrashManager = instance.web.Class.extend({
if (!this.active) {
return;
}
+ if (error.code == -32098) {
+ $.blockUI({ message: '' , overlayCSS: {'z-index': 9999, backgroundColor: '#FFFFFF', opacity: 0.0, cursor: 'wait'}});
+ var $indicator = $('<div class="oe_indicator">' + _t("Trying to reconnect... ") + '<i class="fa fa-refresh fa-spin"></i></div>');
+ $indicator.prependTo("body");
+ var timeinterval = setInterval(function(){
+ openerp.jsonRpc('/web/webclient/version_info').then(function() {
+ clearInterval(timeinterval);
+ $indicator.html(_t("You are back online"));
+ $indicator.delay(2000).fadeOut('slow',function(){
+ $indicator.remove();
+ });
+ $.unblockUI();
+ });
+ }, 2000);
+ return;
+ }
var handler = instance.web.crash_manager_registry.get_object(error.data.name, true);
if (handler) {
new (handler)(this, error).display();