Skip to content

Commit

Permalink
Merge pull request '[PDF] Hide editing text' (#50) from fix/bugfix in…
Browse files Browse the repository at this point in the history
…to release/v8.2.0
  • Loading branch information
Julia Radzhabova committed Sep 27, 2024
2 parents 7805102 + 4445b80 commit bb42a72
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/pdfeditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,7 @@ define([
// annotation text bar
documentHolder.btnCopy.on('click', _.bind(this.onCutCopyPaste, this, {value: 'copy', isFromBar: true}));
documentHolder.btnAddComment.on('click', _.bind(this.addComment, this, {isFromBar: true}));
if (me.mode.isPDFAnnotate && me.mode.canPDFEdit || me.mode.isPDFEdit)
if (me.mode.isEditTextSupport && (me.mode.isPDFAnnotate && me.mode.canPDFEdit || me.mode.isPDFEdit))
documentHolder.btnEditText.on('click', _.bind(this.editText, this));
else
documentHolder.btnEditText.cmpEl.parent().hide().prev('.separator').hide();
Expand Down
1 change: 1 addition & 0 deletions apps/pdfeditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,7 @@ define([
this.appOptions.isBeta = params.asc_getIsBeta();
this.appOptions.isSignatureSupport= false;//this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && (this.permissions.protect!==false);
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isProtectionSupport() && (this.permissions.protect!==false) && !this.appOptions.isForm;
this.appOptions.isEditTextSupport = this.appOptions.isEdit && this.api.asc_isSupportFeature("ooxml");
this.appOptions.canProtect = (this.permissions.protect!==false);
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
this.appOptions.canSubmitForms = this.appOptions.canLicense && (typeof (this.editorConfig.customization) == 'object') && !!this.editorConfig.customization.submitForm && !this.appOptions.isOffline;
Expand Down
2 changes: 1 addition & 1 deletion apps/pdfeditor/main/app/controller/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ define([
$host = $(toolbar.$layout);
if (this.mode.isPDFEdit && this._state.initEditing) {
Array.prototype.push.apply(me.toolbar.lockControls, toolbar.applyLayoutPDFEdit(this.mode));
toolbar.rendererComponentsPDFEdit($host);
toolbar.rendererComponentsPDFEdit($host, this.mode);

setTimeout(function(){
toolbar.createDelayedElementsPDFEdit();
Expand Down
6 changes: 3 additions & 3 deletions apps/pdfeditor/main/app/view/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1244,12 +1244,12 @@ define([
_injectComponent('#slot-btn-form-save', this.btnSaveForm);
},

rendererComponentsPDFEdit: function($host) {
rendererComponentsPDFEdit: function($host, mode) {
var _injectComponent = function (id, cmp) {
Common.Utils.injectComponent($host.findById(id), cmp);
};

_injectComponent('#slot-btn-edittext', this.btnEditText);
mode.isEditTextSupport ? _injectComponent('#slot-btn-edittext', this.btnEditText) : $host.findById('#slot-btn-edittext').parents('.group').hide().next('.separator').hide();
_injectComponent('#slot-field-fontname', this.cmbFontName);
_injectComponent('#slot-field-fontsize', this.cmbFontSize);
_injectComponent('#slot-btn-text-underline', this.btnTextUnderline);
Expand Down Expand Up @@ -1319,7 +1319,7 @@ define([
this.rendererComponentsCommon($host);
if (mode.isEdit) {
this.rendererComponentsAnnotate($host);
mode.isPDFEdit && this.rendererComponentsPDFEdit($host);
mode.isPDFEdit && this.rendererComponentsPDFEdit($host, mode);
$host.find(mode.isPDFEdit ? '.annotate' : '.pdfedit').addClass('hidden');
} else if (mode.isRestrictedEdit)
this.rendererComponentsRestrictedEdit($host);
Expand Down

0 comments on commit bb42a72

Please sign in to comment.