[Libreoffice-commits] online.git: loleaflet/src
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Sun Apr 24 22:22:26 UTC 2016
loleaflet/src/core/Socket.js | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 381badc3cb908c96fcef9259fccaa2e8ad76f6a8
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sun Apr 24 16:48:32 2016 -0400
loleaflet: Socket.connected() to report socket connection state
Change-Id: Ib777f1af52dac518ceae7234334af4108943fc07
Reviewed-on: https://gerrit.libreoffice.org/24350
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index d2d1ca4..457ff75 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -30,6 +30,10 @@ L.Socket = L.Class.extend({
this.socket.close();
},
+ connected: function() {
+ return this.socket && this.socket.readyState === 1;
+ },
+
sendMessage: function (msg, coords) {
if (!msg.startsWith('useractive') && !msg.startsWith('userinactive') && !this._active) {
// Avoid communicating when we're inactive.
More information about the Libreoffice-commits
mailing list