From 97c7708d0dabb81adb2e1c969896db722cdabed0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 28 Jun 2021 22:17:56 +0300 Subject: [PATCH] Disable save, undo/redo on disconnect --- apps/documenteditor/main/app/view/Toolbar.js | 4 ++++ apps/presentationeditor/main/app/view/Toolbar.js | 3 +++ apps/spreadsheeteditor/main/app/view/Toolbar.js | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 76b0d9fe5..aaa31a73c 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -2082,6 +2082,10 @@ define([ setMode: function (mode) { if (mode.isDisconnected) { this.btnSave.setDisabled(true); + this.btnUndo.setDisabled(true); + this.btnRedo.setDisabled(true); + if ( this.synchTooltip ) + this.synchTooltip.hide(); if (!mode.enableDownload) this.btnPrint.setDisabled(true); } diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 2cfc5e353..155d277be 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1398,6 +1398,9 @@ define([ setMode: function (mode) { if (mode.isDisconnected) { this.lockToolbar(PE.enumLock.lostConnect, true); + this.lockToolbar( PE.enumLock.lostConnect, true, {array:[this.btnUndo,this.btnRedo,this.btnSave]} ); + if ( this.synchTooltip ) + this.synchTooltip.hide(); if (!mode.enableDownload) this.lockToolbar(PE.enumLock.cantPrint, true, {array: [this.btnPrint]}); } else diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 54e6b0f38..fb482ea8d 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -396,6 +396,7 @@ define([ id : 'id-toolbar-btn-save', cls : 'btn-toolbar', iconCls : 'toolbar__icon no-mask ' + me.btnSaveCls, + lock : [_set.lostConnect], signals : ['disabled'] }); me.btnCollabChanges = me.btnSave; @@ -2213,7 +2214,9 @@ define([ if (mode.isDisconnected) { this.lockToolbar( SSE.enumLock.lostConnect, true ); this.lockToolbar( SSE.enumLock.lostConnect, true, - {array:[this.btnEditChart, this.btnEditChartData, this.btnEditChartType, this.btnUndo,this.btnRedo]} ); + {array:[this.btnEditChart, this.btnEditChartData, this.btnEditChartType, this.btnUndo,this.btnRedo,this.btnSave]} ); + if ( this.synchTooltip ) + this.synchTooltip.hide(); if (!mode.enableDownload) this.lockToolbar(SSE.enumLock.cantPrint, true, {array: [this.btnPrint]}); } else {