feat(frontend): set read-only on load if read-only whiteboard

This commit is contained in:
Florent Chehab 2020-05-12 23:05:20 +02:00
parent 522d1b72a7
commit fd05f220f3
No known key found for this signature in database
GPG Key ID: 9A0CE018889EA246
2 changed files with 7 additions and 0 deletions

View File

@ -685,6 +685,9 @@ function initWhiteboard() {
ReadOnlyService.deactivateReadOnlyMode();
InfoService.displayInfo();
}
// In any case, if we are on read-only whiteboard we activate read-only mode
if (ConfigService.isReadOnly) ReadOnlyService.activateReadOnlyMode();
});
//Prevent site from changing tab on drag&drop

View File

@ -1,3 +1,5 @@
import ConfigService from "./ConfigService";
/**
* Class the handle the read-only logic
*/
@ -40,6 +42,8 @@ class ReadOnlyService {
* Deactivate read-only mode
*/
deactivateReadOnlyMode() {
if (ConfigService.isReadOnly) return;
this.#readOnlyActive = false;
$(".whiteboard-tool").prop("disabled", false);