mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
[PDF] Fix save button lock
This commit is contained in:
@ -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');
|
||||
}
|
||||
|
||||
@ -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;
|
||||
},
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user