Disable save, undo/redo on disconnect

This commit is contained in:
Julia Radzhabova 2021-06-28 22:17:56 +03:00
parent be57b1fae7
commit 97c7708d0d
3 changed files with 11 additions and 1 deletions

View file

@ -2082,6 +2082,10 @@ define([
setMode: function (mode) { setMode: function (mode) {
if (mode.isDisconnected) { if (mode.isDisconnected) {
this.btnSave.setDisabled(true); this.btnSave.setDisabled(true);
this.btnUndo.setDisabled(true);
this.btnRedo.setDisabled(true);
if ( this.synchTooltip )
this.synchTooltip.hide();
if (!mode.enableDownload) if (!mode.enableDownload)
this.btnPrint.setDisabled(true); this.btnPrint.setDisabled(true);
} }

View file

@ -1398,6 +1398,9 @@ define([
setMode: function (mode) { setMode: function (mode) {
if (mode.isDisconnected) { if (mode.isDisconnected) {
this.lockToolbar(PE.enumLock.lostConnect, true); 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) if (!mode.enableDownload)
this.lockToolbar(PE.enumLock.cantPrint, true, {array: [this.btnPrint]}); this.lockToolbar(PE.enumLock.cantPrint, true, {array: [this.btnPrint]});
} else } else

View file

@ -396,6 +396,7 @@ define([
id : 'id-toolbar-btn-save', id : 'id-toolbar-btn-save',
cls : 'btn-toolbar', cls : 'btn-toolbar',
iconCls : 'toolbar__icon no-mask ' + me.btnSaveCls, iconCls : 'toolbar__icon no-mask ' + me.btnSaveCls,
lock : [_set.lostConnect],
signals : ['disabled'] signals : ['disabled']
}); });
me.btnCollabChanges = me.btnSave; me.btnCollabChanges = me.btnSave;
@ -2213,7 +2214,9 @@ define([
if (mode.isDisconnected) { if (mode.isDisconnected) {
this.lockToolbar( SSE.enumLock.lostConnect, true ); this.lockToolbar( SSE.enumLock.lostConnect, true );
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) if (!mode.enableDownload)
this.lockToolbar(SSE.enumLock.cantPrint, true, {array: [this.btnPrint]}); this.lockToolbar(SSE.enumLock.cantPrint, true, {array: [this.btnPrint]});
} else { } else {