diff options
| author | Hitesh Trivedi <htr@openerp.com> | 2014-12-18 14:47:49 +0530 |
|---|---|---|
| committer | Richard Mathot <rim@odoo.com> | 2015-02-20 16:45:48 +0100 |
| commit | 4cdc19198ee540299f69b76d5b183464d3ee3579 (patch) | |
| tree | c6a46cb0c4f06a92f4bd116f224ad95861763f8f /addons/web/static/src/js/chrome.js | |
| parent | 069e2be87d8250d364711b01912f34b7261ea0ba (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.js | 16 |
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(); |
