webapp: Improve javascript's handling of longpolling connection failures, by reloading the current page in this case. Works around chromium behavior where ajax connections to urls that were already accessed are denied after navigating back to a previous page.
This commit is contained in:
parent
9d7bd5d900
commit
b5678d74a2
4 changed files with 8 additions and 18 deletions
|
@ -3,7 +3,7 @@ $(function() {
|
|||
var f = function() {
|
||||
longpoll(url, #{ident}
|
||||
, function() { setTimeout(f, #{delay}); }
|
||||
, function() { webapp_disconnected(); }
|
||||
, function() { window.location.reload(true); }
|
||||
);
|
||||
};
|
||||
setTimeout(f, #{startdelay});
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
connfailed =
|
||||
'<div id="modal" class="modal fade">' +
|
||||
' <div class="modal-header">' +
|
||||
' <h3>git-annex has shut down</h3>' +
|
||||
' </div>' +
|
||||
' <div class="modal-body">' +
|
||||
' You can now close this browser window.' +
|
||||
' </div>' +
|
||||
'</div>' ;
|
||||
|
||||
function webapp_disconnected () {
|
||||
$('#modal').replaceWith(connfailed);
|
||||
$('#modal').modal('show');
|
||||
|
||||
// ideal, but blocked by many browsers
|
||||
window.close();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue