mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 16:02:46 +08:00
[PDF] Fix change-mode button
This commit is contained in:
@ -259,9 +259,9 @@ define([
|
||||
var me = this;
|
||||
config = config || appConfig;
|
||||
if (!me.btnPDFMode || !config) return;
|
||||
me.btnPDFMode.setIconCls('toolbar__icon icon--inverse ' + (config.isPDFEdit ? 'btn-edit' : (config.isPDFAnnotate ? 'btn-menu-comments' : 'btn-sheet-view')));
|
||||
me.btnPDFMode.setCaption(config.isPDFEdit ? me.textEdit : (config.isPDFAnnotate ? me.textComment : me.textView));
|
||||
me.btnPDFMode.updateHint(config.isPDFEdit ? me.tipEdit : (config.isPDFAnnotate ? me.tipComment : me.tipView));
|
||||
me.btnPDFMode.setIconCls('toolbar__icon icon--inverse ' + (config.isPDFEdit ? 'btn-edit' : (config.isPDFAnnotate && config.canCoEditing ? 'btn-menu-comments' : 'btn-sheet-view')));
|
||||
me.btnPDFMode.setCaption(config.isPDFEdit ? me.textEdit : (config.isPDFAnnotate && config.canCoEditing ? me.textComment : me.textView));
|
||||
me.btnPDFMode.updateHint(config.isPDFEdit ? me.tipEdit : (config.isPDFAnnotate && config.canCoEditing ? me.tipComment : me.tipView));
|
||||
}
|
||||
|
||||
function changeDocMode(type, lockEditing) {
|
||||
@ -445,18 +445,18 @@ define([
|
||||
caption: me.textEdit,
|
||||
iconCls : 'menu__icon btn-edit',
|
||||
template: menuTemplate,
|
||||
description: me.textEditDesc,
|
||||
description: appConfig.canCoEditing ? me.textEditDesc : me.textEditDescNoCoedit,
|
||||
value: 'edit'
|
||||
});
|
||||
arr.push({
|
||||
caption: me.textComment,
|
||||
iconCls : 'menu__icon btn-menu-comments',
|
||||
caption: appConfig.canCoEditing ? me.textComment : me.textView,
|
||||
iconCls : 'menu__icon ' + (appConfig.canCoEditing ? 'btn-menu-comments' : 'btn-sheet-view'),
|
||||
template: menuTemplate,
|
||||
description: me.textCommentDesc,
|
||||
description: appConfig.canCoEditing ? me.textCommentDesc : me.textViewDescNoCoedit,
|
||||
value: 'comment',
|
||||
disabled: !appConfig.canPDFAnnotate
|
||||
});
|
||||
arr.push({
|
||||
appConfig.canCoEditing && arr.push({
|
||||
caption: me.textView,
|
||||
iconCls : 'menu__icon btn-sheet-view',
|
||||
template: menuTemplate,
|
||||
@ -1119,6 +1119,8 @@ define([
|
||||
textViewDesc: 'All changes will be saved locally',
|
||||
textCommentDesc: 'All changes will be saved to the file. Real time collaboration',
|
||||
textEditDesc: 'All changes will be saved to the file. Real time collaboration',
|
||||
textViewDescNoCoedit: 'View or annotate',
|
||||
textEditDescNoCoedit: 'Add or edit text, shapes, images etc.',
|
||||
tipView: 'Viewing',
|
||||
tipComment: 'Commenting',
|
||||
tipEdit: 'Editing',
|
||||
|
||||
@ -1223,10 +1223,11 @@ define([
|
||||
this.appOptions.canSwitchMode = pdfEdit; // switch between View/pdf comments/pdf edit
|
||||
this.appOptions.canEdit = this.appOptions.isEdit = pdfEdit;
|
||||
|
||||
this.appOptions.canCoEditing = false; // TODO: !(this.appOptions.isDesktopApp && this.appOptions.isOffline), switch between pdf comment/ pdf edit when false
|
||||
this.appOptions.canSaveToFile = this.appOptions.isDesktopApp && this.appOptions.isOffline;
|
||||
this.appOptions.canPDFAnnotate = pdfEdit && this.appOptions.canLicense && (this.permissions.comment!== false) && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
||||
this.appOptions.canPDFAnnotate = pdfEdit && this.appOptions.canLicense;// && (this.permissions.comment!== false) && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false) || this.appOptions.isDesktopApp && this.appOptions.isOffline;
|
||||
this.appOptions.isPDFAnnotate = this.appOptions.canPDFAnnotate; // TODO: this.appOptions.isDesktopApp && this.appOptions.isOffline !! online files always open in view mode
|
||||
this.appOptions.canPDFEdit = pdfEdit && this.appOptions.canLicense;//(this.permissions.edit !== false);
|
||||
this.appOptions.canPDFEdit = pdfEdit && this.appOptions.canLicense;//(this.permissions.edit !== false) || this.appOptions.isDesktopApp && this.appOptions.isOffline;
|
||||
this.appOptions.isPDFEdit = false; // this.appOptions.canPDFEdit && this.editorConfig.mode !== 'view'; !! always open in view mode
|
||||
|
||||
this.appOptions.canComments = this.appOptions.canViewComments = pdfEdit;
|
||||
|
||||
@ -74,6 +74,19 @@
|
||||
<span class="btn-slot text slot-btn-ftw" style="text-align: center;"></span>
|
||||
</div>
|
||||
</div>
|
||||
<% if ( config.isRestrictedEdit) { %>
|
||||
<div class="separator long"></div>
|
||||
<div class="group" style="">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-prev"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-next"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-clear"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group" style="">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-submit"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-save"></span>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<div class="group pdfedit">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-edittext"></span>
|
||||
</div>
|
||||
@ -127,18 +140,6 @@
|
||||
<span class="btn-slot split" id="slot-btn-align-shape"></span>
|
||||
</div>
|
||||
</div>
|
||||
<% if ( config.isRestrictedEdit) { %>
|
||||
<div class="separator long"></div>
|
||||
<div class="group" style="">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-prev"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-next"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-clear"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group" style="">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-submit"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-save"></span>
|
||||
</div>
|
||||
<% } %>
|
||||
</section>
|
||||
<section class="panel" data-tab="comment">
|
||||
|
||||
Reference in New Issue
Block a user