mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
[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:
parent
32ed4315e2
commit
0bd4169663
2 changed files with 38 additions and 19 deletions
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue