diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index dcf87cd48a..f5c5e21eca 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -566,7 +566,7 @@ define([ } application.getController('DocumentHolder').getView().focus(); - if (this.api) { + if (this.api && !toolbarView._state.previewmode) { var cansave = this.api.asc_isDocumentCanSave(), forcesave = this.appOptions.forcesave; var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'); @@ -1393,7 +1393,7 @@ define([ var toolbarView = this.getApplication().getController('Toolbar').getView(); - if (toolbarView) { + if (toolbarView && !toolbarView._state.previewmode) { var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'), forcesave = this.appOptions.forcesave; if (toolbarView.btnSave.isDisabled() !== (!isModified && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave)) @@ -1411,7 +1411,7 @@ define([ toolbarController = application.getController('Toolbar'), toolbarView = toolbarController.getView(); - if (toolbarView && this.api) { + if (toolbarView && this.api && !toolbarView._state.previewmode) { var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'), forcesave = this.appOptions.forcesave; if (toolbarView.btnSave.isDisabled() !== (!isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave)) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 389e688d41..b00b329d62 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2775,10 +2775,18 @@ define([ disable = disable || (reviewmode ? toolbar_mask.length>0 : group_mask.length>0); toolbar.$el.find('.toolbar').toggleClass('masked', disable); toolbar.btnHide.setDisabled(disable); - disable ? Common.util.Shortcuts.suspendEvents('alt+h') : Common.util.Shortcuts.resumeEvents('alt+h'); - if ( toolbar.synchTooltip ) toolbar.synchTooltip.hide(); + + toolbar._state.previewmode = reviewmode && disable; + if (reviewmode) { + toolbar._state.previewmode && toolbar.btnSave.setDisabled(toolbar._state.previewmode); + if (toolbar.needShowSynchTip) { + toolbar.needShowSynchTip = false; + toolbar.onCollaborativeChanges(); + } + } + disable ? Common.util.Shortcuts.suspendEvents('alt+h') : Common.util.Shortcuts.resumeEvents('alt+h'); }, onSelectRecepientsClick: function() { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 597f51dd5f..88a7b2371d 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -103,7 +103,8 @@ define([ this.toolbarControls = []; this.textOnlyControls = []; this._state = { - hasCollaborativeChanges: undefined + hasCollaborativeChanges: undefined, + previewmode: false }; this.btnSaveCls = 'btn-save'; this.btnSaveTip = this.tipSave + Common.Utils.String.platformKey('Ctrl+S'); @@ -2202,6 +2203,10 @@ define([ this.needShowSynchTip = true; return; } + if (this._state.previewmode) { + if (!DE.getController('Main')._state.fastCoauth) this.needShowSynchTip = true; + return; + } this._state.hasCollaborativeChanges = true; var iconEl = $('.icon', this.btnSave.cmpEl); @@ -2238,7 +2243,7 @@ define([ }, synchronizeChanges: function () { - if (this.btnSave.rendered) { + if (!this._state.previewmode && this.btnSave.rendered) { var iconEl = $('.icon', this.btnSave.cmpEl); if (iconEl.hasClass('btn-synch')) {