mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-17 14:37:58 +00:00
fix
This commit is contained in:
parent
49eb940004
commit
5f4935f6ce
@ -44,19 +44,26 @@ define([
|
|||||||
$num.addClass('hide');
|
$num.addClass('hide');
|
||||||
document.title = _this.orig_doc_title;
|
document.title = _this.orig_doc_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var $networkNotice = $('#network-top-notice');
|
||||||
|
if ($networkNotice.is(':visible')) {
|
||||||
|
$networkNotice.remove();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function(xhr) { // e.g. 401 UNAUTHORIZED
|
error: function(xhr) { // e.g. 401 UNAUTHORIZED
|
||||||
clearInterval(reqInterval); // stop sending requests
|
|
||||||
|
|
||||||
var $el;
|
var $el;
|
||||||
if (xhr.responseText) {
|
if (xhr.responseText) {
|
||||||
if (xhr.status == 401) {
|
if (xhr.status == 401) {
|
||||||
|
clearInterval(reqInterval); // stop sending requests
|
||||||
$el = $('<p class="top-bar fixed-top-bar">' + gettext("You have logged out.") + '<span class="top-bar-click">' + gettext("Log in") + '</span></p>');
|
$el = $('<p class="top-bar fixed-top-bar">' + gettext("You have logged out.") + '<span class="top-bar-click">' + gettext("Log in") + '</span></p>');
|
||||||
|
$('#wrapper').prepend($el);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$el = $('<p class="top-bar fixed-top-bar">' + gettext("Please check the network.") + '</p>');
|
if ($('#network-top-notice').length == 0) {
|
||||||
|
$el = $('<p class="top-bar fixed-top-bar" id="network-top-notice">' + gettext("Please check the network.") + '<span class="top-bar-click">' + gettext("Refresh") + '</span></p>');
|
||||||
|
$('#wrapper').prepend($el);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$('#wrapper').prepend($el);
|
|
||||||
$('.top-bar-click', $el).click(function() {
|
$('.top-bar-click', $el).click(function() {
|
||||||
location.reload(true);
|
location.reload(true);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user