From 8ea6c030943f9b51a2ac9301c832e3b889e9da26 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 25 Jul 2016 11:57:06 +0200 Subject: [PATCH] notify user on disconnect also disable inputs --- www/poll/main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/www/poll/main.js b/www/poll/main.js index b8471017e..3e962a726 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -94,9 +94,7 @@ define([ var setEditable = function (bool) { module.isEditable = bool; - items.forEach(function ($item) { - $item.attr('disabled', !bool); - }); + $('input, textarea').attr('disabled', !bool); }; var coluid = Uid('x'); @@ -477,5 +475,9 @@ define([ realtime: realtime, logging: true, }); - }).on('ready', ready); + }).on('ready', ready) + .on('disconnect', function () { + setEditable(false); + Cryptpad.alert("Network connection lost!"); + }); });