mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04: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);
|
console.warn(obj);
|
||||||
padconnectionstatus.disconnected(obj.disconnect);
|
padconnectionstatus.disconnected(obj.disconnect);
|
||||||
socket.disconnect();
|
socket.disconnect();
|
||||||
|
|
||||||
|
// block user from making any change to the pad
|
||||||
|
padeditor.disable();
|
||||||
|
padeditbar.disable();
|
||||||
|
padimpexp.disable();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -33,6 +33,19 @@ describe('Automatic pad reload on Force Reconnect message', function() {
|
||||||
done();
|
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() {
|
context('and user clicks on Cancel', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
var $errorMessageModal = helper.padChrome$('#connectivity .userdup');
|
var $errorMessageModal = helper.padChrome$('#connectivity .userdup');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue