Fix the infinite spinner problem

pull/1/head
yflory 8 years ago
parent 4cd9bd5534
commit 05fd6c1563

@ -687,6 +687,11 @@ define([
} }
}; };
var onError = config.onError = function (info) {
module.spinner.hide();
Cryptpad.alert(Messages.websocketError);
};
var realtime = module.realtime = Realtime.start(config); var realtime = module.realtime = Realtime.start(config);
editor.on('change', onLocal); editor.on('change', onLocal);

@ -550,6 +550,7 @@ define([
$(function() { $(function() {
// Race condition : if document.body is undefined when alertify.js is loaded, Alertify // Race condition : if document.body is undefined when alertify.js is loaded, Alertify
// won't work. We have to reset it now to make sure it uses a correct "body" // won't work. We have to reset it now to make sure it uses a correct "body"
Alertify.reset(); Alertify.reset();
if($('#pad-iframe').length) { if($('#pad-iframe').length) {
var $iframe = $('#pad-iframe'); var $iframe = $('#pad-iframe');
@ -839,6 +840,7 @@ define([
var styleAlerts = common.styleAlerts = function (href) { var styleAlerts = common.styleAlerts = function (href) {
var $link = $('link[href="/customize/alertify.css"]'); var $link = $('link[href="/customize/alertify.css"]');
if ($link.length) { if ($link.length) {
return;
$link.attr('href', ''); $link.attr('href', '');
$link.attr('href', '/customize/alertify.css'); $link.attr('href', '/customize/alertify.css');
return; return;

@ -313,12 +313,11 @@ define([
} }
} }
else if (!firstConnection) { else if (!firstConnection) {
lagErrors++;
// Display the red light at the 2nd failed attemp to get the lag // Display the red light at the 2nd failed attemp to get the lag
if (lagErrors > 1) { //if (lagErrors > 1) {
lagLight.addClass('lag-red'); lagLight.addClass('lag-red');
title = Messages.redLight; title = Messages.redLight;
} //}
} }
if (title) { if (title) {
lagLight.attr('title', title); lagLight.attr('title', title);

@ -691,6 +691,11 @@ define([
} }
}; };
var onError = realtimeOptions.onError = function (info) {
module.spinner.hide();
Cryptpad.alert(Messages.websocketError);
};
var onLocal = realtimeOptions.onLocal = function () { var onLocal = realtimeOptions.onLocal = function () {
if (initializing) { return; } if (initializing) { return; }
if (readOnly) { return; } if (readOnly) { return; }

@ -786,6 +786,11 @@ define([
} }
}; };
var onError = config.onError = function (info) {
module.spinner.hide();
Cryptpad.alert(Messages.websocketError);
};
var realtime = module.realtime = Realtime.start(config); var realtime = module.realtime = Realtime.start(config);
editor.on('change', onLocal); editor.on('change', onLocal);

Loading…
Cancel
Save