From a8926e2ced625074adcb291b17394c8d40ff9f2d Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 10 Dec 2016 11:33:36 +0200 Subject: [PATCH] Stop refreshing the page on every socket.io error --- client/css/style.css | 22 ++++++++++++++++++++++ client/index.html | 1 + client/js/lounge.js | 43 +++++++++++++++++++++++++++++-------------- 3 files changed, 52 insertions(+), 14 deletions(-) diff --git a/client/css/style.css b/client/css/style.css index 43442956..e34f89f7 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -1302,6 +1302,7 @@ button { -webkit-flex: 0 0 auto; flex: 0 0 auto; padding: 5px; + position: relative; } #windows #form .input { @@ -1317,6 +1318,27 @@ button { align-items: flex-end; } +#connection-error { + display: none; + align-items: center; + justify-content: center; + line-height: 1; + background: #f44336; + color: #fff; + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + padding: 5px; + z-index: 30; + cursor: pointer; +} + +#connection-error.shown { + display: flex; +} + [contenteditable]:focus { outline: none; } diff --git a/client/index.html b/client/index.html index a1a13c40..01004283 100644 --- a/client/index.html +++ b/client/index.html @@ -58,6 +58,7 @@
+
Client connection lost. Click to reconnect.