mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
disconnect event
This commit is contained in:
@@ -31,10 +31,16 @@ var socket,
|
||||
|
||||
contentEl.value = data.post;
|
||||
});
|
||||
|
||||
socket.on('disconnect', function(data){
|
||||
$('#disconnect-modal').show();
|
||||
$('#reload-button').on('click',function(){
|
||||
$('#disconnect-modal').hide();
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
},
|
||||
async: false
|
||||
|
||||
|
||||
});
|
||||
|
||||
// use unique alert_id to have multiple alerts visible at a time, use the same alert_id to fade out the current instance
|
||||
|
||||
@@ -78,6 +78,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="disconnect-modal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<h3 id="myModalLabel">Socket Disconnect</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<span>Looks like you disconnected, try reloading the page.</span>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a id="reload-button" href="/" class="btn btn-primary">Reload</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="notification_window"></div>
|
||||
|
||||
<div class="container" id="content">
|
||||
Reference in New Issue
Block a user