[fix] Block user from changing pad after he/she is disconnected

Use same approach of when channel state is chaged to "DISCONNECTED".
This commit is contained in:
Luiza Pagliari 2017-05-03 12:59:57 -03:00
parent 32ed4315e2
commit 0bd4169663
2 changed files with 38 additions and 19 deletions

View file

@ -335,6 +335,12 @@ function handshake()
console.warn(obj);
padconnectionstatus.disconnected(obj.disconnect);
socket.disconnect();
// block user from making any change to the pad
padeditor.disable();
padeditbar.disable();
padimpexp.disable();
return;
}
else

View file

@ -33,6 +33,19 @@ describe('Automatic pad reload on Force Reconnect message', function() {
done();
});
it('disables editor', function(done) {
var editorDocument = helper.padOuter$("iframe[name='ace_inner']").get(0).contentDocument;
var editorBody = editorDocument.getElementById('innerdocbody');
var editorIsEditable = editorBody.contentEditable === 'false' // IE/Safari
|| editorDocument.designMode === 'off'; // other browsers
expect(editorIsEditable).to.be(true);
done();
});
context('and user clicks on Cancel', function() {
beforeEach(function() {
var $errorMessageModal = helper.padChrome$('#connectivity .userdup');