[PDF] Fix save button lock

This commit is contained in:
Julia Radzhabova
2024-10-23 15:31:33 +03:00
parent cac5e1f6e2
commit f6d4269132
3 changed files with 6 additions and 6 deletions

View File

@ -802,7 +802,7 @@ define([
forcesave = this.appOptions.forcesave || this.appOptions.canSaveDocumentToBinary,
isSyncButton = (toolbarView.btnCollabChanges && toolbarView.btnCollabChanges.rendered) ? toolbarView.btnCollabChanges.cmpEl.hasClass('notify') : false,
isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave || !this.appOptions.isPDFEdit && !this.appOptions.isPDFAnnotate;
toolbarView.btnSave.setDisabled(isDisabled && this.appOptions.canSaveToFile);
toolbarView.btnSave.setDisabled(isDisabled && this.appOptions.canSaveToFile || !this.appOptions.showSaveButton);
}
Common.UI.HintManager.clearHints(true);
@ -2052,7 +2052,7 @@ define([
var isSyncButton = toolbarView.btnCollabChanges.cmpEl.hasClass('notify'),
forcesave = this.appOptions.forcesave || this.appOptions.canSaveDocumentToBinary,
isDisabled = !isModified && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave || !this.appOptions.isPDFEdit && !this.appOptions.isPDFAnnotate;
toolbarView.btnSave.setDisabled(isDisabled && this.appOptions.canSaveToFile);
toolbarView.btnSave.setDisabled(isDisabled && this.appOptions.canSaveToFile || !this.appOptions.showSaveButton);
if (this.appOptions.canSaveToFile) {
!isSyncButton && !isDisabled ? Common.UI.TooltipManager.showTip('pdfSave') : Common.UI.TooltipManager.closeTip('pdfSave');
@ -2073,7 +2073,7 @@ define([
var isSyncButton = toolbarView.btnCollabChanges.cmpEl.hasClass('notify'),
forcesave = this.appOptions.forcesave || this.appOptions.canSaveDocumentToBinary,
isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave || !this.appOptions.isPDFEdit && !this.appOptions.isPDFAnnotate;
toolbarView.btnSave.setDisabled(isDisabled && this.appOptions.canSaveToFile);
toolbarView.btnSave.setDisabled(isDisabled && this.appOptions.canSaveToFile || !this.appOptions.showSaveButton);
if (this.appOptions.canSaveToFile) {
!isSyncButton && !isDisabled ? Common.UI.TooltipManager.showTip('pdfSave') : Common.UI.TooltipManager.closeTip('pdfSave');
}

View File

@ -738,7 +738,7 @@ define([
return;
this.api.asc_Save();
toolbar.btnSave && toolbar.btnSave.setDisabled(!toolbar.mode.forcesave && toolbar.mode.canSaveToFile && !toolbar.mode.canSaveDocumentToBinary);
toolbar.btnSave && toolbar.btnSave.setDisabled(!toolbar.mode.forcesave && toolbar.mode.canSaveToFile && !toolbar.mode.canSaveDocumentToBinary || !toolbar.mode.showSaveButton);
Common.component.Analytics.trackEvent('Save');
Common.component.Analytics.trackEvent('ToolBar', 'Save');
Common.UI.TooltipManager.closeTip('pdfSave');
@ -1195,7 +1195,7 @@ define([
this.toolbar.lockToolbar(Common.enumLock.redoLock, this._state.can_redo!==true, {array: [this.toolbar.btnRedo]});
this.toolbar.lockToolbar(Common.enumLock.copyLock, this._state.can_copy!==true, {array: [this.toolbar.btnCopy]});
this.toolbar.lockToolbar(Common.enumLock.cutLock, this._state.can_cut!==true, {array: [this.toolbar.btnCut]});
this.api && this.toolbar.btnSave && this.toolbar.btnSave.setDisabled(this.mode.canSaveToFile && !this.api.isDocumentModified());
this.api && this.toolbar.btnSave && this.toolbar.btnSave.setDisabled(this.mode.canSaveToFile && !this.api.isDocumentModified() || !this.mode.showSaveButton);
this._state.activated = true;
},

View File

@ -1740,7 +1740,7 @@ define([
this.synchTooltip.hide();
this.btnCollabChanges.updateHint(this.btnSaveTip);
this.btnSave.setDisabled(!me.mode.forcesave && !me.mode.canSaveDocumentToBinary || !me.mode.isPDFEdit && !me.mode.isPDFAnnotate && me.mode.canSaveToFile);
this.btnSave.setDisabled(!me.mode.forcesave && !me.mode.canSaveDocumentToBinary || !me.mode.isPDFEdit && !me.mode.isPDFAnnotate && me.mode.canSaveToFile || !me.mode.showSaveButton);
this._state.hasCollaborativeChanges = false;
}
}