[DE] Fix Bug 35757. Disable save button in the preview mode for review.
This commit is contained in:
parent
cfed1c50b8
commit
e86804cbb2
|
@ -566,7 +566,7 @@ define([
|
||||||
}
|
}
|
||||||
application.getController('DocumentHolder').getView().focus();
|
application.getController('DocumentHolder').getView().focus();
|
||||||
|
|
||||||
if (this.api) {
|
if (this.api && !toolbarView._state.previewmode) {
|
||||||
var cansave = this.api.asc_isDocumentCanSave(),
|
var cansave = this.api.asc_isDocumentCanSave(),
|
||||||
forcesave = this.appOptions.forcesave;
|
forcesave = this.appOptions.forcesave;
|
||||||
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch');
|
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch');
|
||||||
|
@ -1393,7 +1393,7 @@ define([
|
||||||
|
|
||||||
var toolbarView = this.getApplication().getController('Toolbar').getView();
|
var toolbarView = this.getApplication().getController('Toolbar').getView();
|
||||||
|
|
||||||
if (toolbarView) {
|
if (toolbarView && !toolbarView._state.previewmode) {
|
||||||
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||||
forcesave = this.appOptions.forcesave;
|
forcesave = this.appOptions.forcesave;
|
||||||
if (toolbarView.btnSave.isDisabled() !== (!isModified && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !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'),
|
toolbarController = application.getController('Toolbar'),
|
||||||
toolbarView = toolbarController.getView();
|
toolbarView = toolbarController.getView();
|
||||||
|
|
||||||
if (toolbarView && this.api) {
|
if (toolbarView && this.api && !toolbarView._state.previewmode) {
|
||||||
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||||
forcesave = this.appOptions.forcesave;
|
forcesave = this.appOptions.forcesave;
|
||||||
if (toolbarView.btnSave.isDisabled() !== (!isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave))
|
if (toolbarView.btnSave.isDisabled() !== (!isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave))
|
||||||
|
|
|
@ -2775,10 +2775,18 @@ define([
|
||||||
disable = disable || (reviewmode ? toolbar_mask.length>0 : group_mask.length>0);
|
disable = disable || (reviewmode ? toolbar_mask.length>0 : group_mask.length>0);
|
||||||
toolbar.$el.find('.toolbar').toggleClass('masked', disable);
|
toolbar.$el.find('.toolbar').toggleClass('masked', disable);
|
||||||
toolbar.btnHide.setDisabled(disable);
|
toolbar.btnHide.setDisabled(disable);
|
||||||
disable ? Common.util.Shortcuts.suspendEvents('alt+h') : Common.util.Shortcuts.resumeEvents('alt+h');
|
|
||||||
|
|
||||||
if ( toolbar.synchTooltip )
|
if ( toolbar.synchTooltip )
|
||||||
toolbar.synchTooltip.hide();
|
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() {
|
onSelectRecepientsClick: function() {
|
||||||
|
|
|
@ -103,7 +103,8 @@ define([
|
||||||
this.toolbarControls = [];
|
this.toolbarControls = [];
|
||||||
this.textOnlyControls = [];
|
this.textOnlyControls = [];
|
||||||
this._state = {
|
this._state = {
|
||||||
hasCollaborativeChanges: undefined
|
hasCollaborativeChanges: undefined,
|
||||||
|
previewmode: false
|
||||||
};
|
};
|
||||||
this.btnSaveCls = 'btn-save';
|
this.btnSaveCls = 'btn-save';
|
||||||
this.btnSaveTip = this.tipSave + Common.Utils.String.platformKey('Ctrl+S');
|
this.btnSaveTip = this.tipSave + Common.Utils.String.platformKey('Ctrl+S');
|
||||||
|
@ -2202,6 +2203,10 @@ define([
|
||||||
this.needShowSynchTip = true;
|
this.needShowSynchTip = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this._state.previewmode) {
|
||||||
|
if (!DE.getController('Main')._state.fastCoauth) this.needShowSynchTip = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this._state.hasCollaborativeChanges = true;
|
this._state.hasCollaborativeChanges = true;
|
||||||
var iconEl = $('.icon', this.btnSave.cmpEl);
|
var iconEl = $('.icon', this.btnSave.cmpEl);
|
||||||
|
@ -2238,7 +2243,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
synchronizeChanges: function () {
|
synchronizeChanges: function () {
|
||||||
if (this.btnSave.rendered) {
|
if (!this._state.previewmode && this.btnSave.rendered) {
|
||||||
var iconEl = $('.icon', this.btnSave.cmpEl);
|
var iconEl = $('.icon', this.btnSave.cmpEl);
|
||||||
|
|
||||||
if (iconEl.hasClass('btn-synch')) {
|
if (iconEl.hasClass('btn-synch')) {
|
||||||
|
|
Loading…
Reference in a new issue