"Save" button locked in wrong way in coauth mode for desktop

This commit is contained in:
Julia Radzhabova 2018-04-25 11:09:47 +03:00
parent f623946299
commit 3e3da0e280
3 changed files with 8 additions and 8 deletions

View file

@ -625,7 +625,7 @@ define([
if (this.api && !toolbarView._state.previewmode) {
var cansave = this.api.asc_isDocumentCanSave(),
forcesave = this.appOptions.forcesave,
isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
isSyncButton = toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'),
isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
toolbarView.btnSave.setDisabled(isDisabled);
}
@ -1534,7 +1534,7 @@ define([
var toolbarView = this.getApplication().getController('Toolbar').getView();
if (toolbarView && this.api && !toolbarView._state.previewmode) {
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
var isSyncButton = toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'),
forcesave = this.appOptions.forcesave,
isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
toolbarView.btnSave.setDisabled(isDisabled);

View file

@ -426,7 +426,7 @@ define([
if (this.api && this.api.asc_isDocumentCanSave) {
var cansave = this.api.asc_isDocumentCanSave(),
forcesave = this.appOptions.forcesave,
isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
isSyncButton = toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'),
isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
toolbarView.btnSave.setDisabled(isDisabled);
}
@ -1277,7 +1277,7 @@ define([
onDocumentCanSaveChanged: function (isCanSave) {
var toolbarView = this.getApplication().getController('Toolbar').getView('Toolbar');
if ( toolbarView ) {
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
var isSyncButton = toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'),
forcesave = this.appOptions.forcesave,
isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
toolbarView.btnSave.setDisabled(isDisabled);

View file

@ -1412,8 +1412,8 @@ define([
this.updateWindowTitle(change);
Common.Gateway.setDocumentModified(change);
if (this.toolbarView && this.toolbarView.btnSave && this.api) {
var isSyncButton = $('.icon', this.toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
if (this.toolbarView && this.toolbarView.btnCollabChanges && this.api) {
var isSyncButton = this.toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'),
forcesave = this.appOptions.forcesave,
cansave = this.api.asc_isDocumentCanSave(),
isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
@ -1422,8 +1422,8 @@ define([
},
onDocumentCanSaveChanged: function (isCanSave) {
if (this.toolbarView && this.toolbarView.btnSave) {
var isSyncButton = $('.icon', this.toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
if (this.toolbarView && this.toolbarView.btnCollabChanges) {
var isSyncButton = this.toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'),
forcesave = this.appOptions.forcesave,
isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
this.toolbarView.btnSave.setDisabled(isDisabled);