diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index c44c4ba91a..0d9c67e5f7 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -901,7 +901,8 @@ define([ if ( config.canQuickPrint ) this.btnPrintQuick = createTitleButton('toolbar__icon icon--inverse btn-quick-print', $html.findById('#slot-hbtn-print-quick'), undefined, 'bottom', 'big', 'Q'); } - if ( config.canRequestEditRights && (!config.twoLevelHeader && config.canEdit && !isPDFEditor || config.isPDFForm && config.canFillForms && config.isRestrictedEdit)) + if ( config.canRequestEditRights && (!config.twoLevelHeader && config.canEdit && !isPDFEditor || config.isPDFForm && config.canFillForms && config.isRestrictedEdit || + isPDFEditor && (config.canPDFEdit && !config.isPDFEdit && !config.isPDFAnnotate || config.isPDFFill))) this.btnEdit = createTitleButton('toolbar__icon icon--inverse btn-edit', $html.findById('#slot-hbtn-edit'), undefined, 'bottom', 'big'); me.btnSearch.render($html.find('#slot-btn-search')); diff --git a/apps/pdfeditor/main/app/controller/LeftMenu.js b/apps/pdfeditor/main/app/controller/LeftMenu.js index 32ddac6f99..42a5235437 100644 --- a/apps/pdfeditor/main/app/controller/LeftMenu.js +++ b/apps/pdfeditor/main/app/controller/LeftMenu.js @@ -429,15 +429,15 @@ define([ var fast_coauth = Common.Utils.InternalSettings.get("pdfe-settings-coauthmode"), canPDFSave = (this.mode.isPDFAnnotate || this.mode.isPDFEdit) && !this.mode.isOffline; /** coauthoring begin **/ - if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring && canPDFSave ) { + if (this.mode.isEdit && this.mode.canCoAuthoring && canPDFSave ) { if (this.mode.canChangeCoAuthoring) { - fast_coauth = Common.localStorage.getBool("pdfe-settings-coauthmode", true); - Common.Utils.InternalSettings.set("pdfe-settings-coauthmode", fast_coauth); + // fast_coauth = Common.localStorage.getBool("pdfe-settings-coauthmode", true); + fast_coauth = Common.Utils.InternalSettings.get("pdfe-settings-coauthmode"); this.api.asc_SetFastCollaborative(fast_coauth); } - value = Common.localStorage.getItem((fast_coauth) ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict"); - Common.Utils.InternalSettings.set((fast_coauth) ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict", value); + // value = Common.localStorage.getItem((fast_coauth) ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict"); + value = Common.Utils.InternalSettings.get(fast_coauth ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict"); switch(value) { case 'all': value = Asc.c_oAscCollaborativeMarksShowType.All; break; case 'none': value = Asc.c_oAscCollaborativeMarksShowType.None; break; @@ -468,8 +468,8 @@ define([ if (this.mode.isEdit && canPDFSave) { if (this.mode.canChangeCoAuthoring || !fast_coauth) {// can change co-auth. mode or for strict mode - value = parseInt(Common.localStorage.getItem("pdfe-settings-autosave")); - Common.Utils.InternalSettings.set("pdfe-settings-autosave", value); + // value = parseInt(Common.localStorage.getItem("pdfe-settings-autosave")); + value = Common.Utils.InternalSettings.get("pdfe-settings-autosave"); this.api.asc_setAutoSaveGap(value); } } diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index 88ab0151bd..a23756a086 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -1262,14 +1262,17 @@ define([ this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; var pdfEdit = !this.appOptions.isXpsViewer && !this.appOptions.isForm; - this.appOptions.canSwitchMode = pdfEdit; // switch between View/pdf comments/pdf edit + this.appOptions.canSwitchMode = pdfEdit; // switch between View/pdf comments/pdf edit TODO: can switch only in edit mode 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.canPDFAnnotate = pdfEdit && this.appOptions.canLicense;// && (this.permissions.comment!== 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.isDesktopApp && this.appOptions.isOffline; + this.appOptions.canCoEditing = false; // TODO: !(this.appOptions.isDesktopApp && this.appOptions.isOffline), switch between pdf comment/ pdf edit when false and can edit pdf + + this.appOptions.canPDFAnnotate = pdfEdit && this.appOptions.canLicense && (this.permissions.comment!== false || this.appOptions.isDesktopApp && this.appOptions.isOffline); + this.appOptions.isPDFAnnotate = this.appOptions.canPDFAnnotate && (this.editorConfig.mode !== 'view'); // 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.isDesktopApp && this.appOptions.isOffline); this.appOptions.isPDFEdit = false; // this.appOptions.canPDFEdit && this.editorConfig.mode !== 'view'; !! always open in view mode + // isPDFFill - can fill forms, co-edit and save changes to file + this.appOptions.isPDFFill = pdfEdit && this.appOptions.canLicense && (this.permissions.fillForms!==false) && !this.appOptions.canPDFAnnotate && !this.appOptions.canPDFEdit && (this.editorConfig.mode !== 'view'); this.appOptions.canComments = this.appOptions.canViewComments = pdfEdit && !(this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !(this.permissions.chat===false || (this.permissions.chat===undefined) && @@ -1303,8 +1306,9 @@ define([ this.appOptions.canFillForms = this.appOptions.canLicense && this.appOptions.isForm && ((this.permissions.fillForms===undefined) ? (this.permissions.edit !== false) : this.permissions.fillForms) && (this.editorConfig.mode !== 'view'); this.appOptions.isAnonymousSupport = !!this.api.asc_isAnonymousSupport(); this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canFillForms; - this.appOptions.canSaveToFile = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline || this.appOptions.isRestrictedEdit; - this.appOptions.showSaveButton = this.appOptions.isEdit; + this.appOptions.canSaveToFile = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline || this.appOptions.isRestrictedEdit || + this.appOptions.isPDFFill || this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit; + this.appOptions.showSaveButton = this.appOptions.isEdit && !this.appOptions.isPDFFill; this.appOptions.compactHeader = this.appOptions.customization && (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compactHeader; this.appOptions.twoLevelHeader = this.appOptions.isEdit || this.appOptions.isRestrictedEdit; // when compactHeader=true some buttons move to toolbar @@ -1371,7 +1375,8 @@ define([ this.appOptions.canLiveView = false; this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false); - this.loadCoAuthSettings(); + // this.loadCoAuthSettings(); + this.loadCoAuthSettingsPdf(); this.applyModeCommonElements(); this.applyModeEditorElements(); @@ -1384,11 +1389,19 @@ define([ this.api.asc_setViewMode(!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit); this.api.asc_setCanSendChanges(this.appOptions.canSaveToFile); - this.api.asc_setRestriction(this.appOptions.isRestrictedEdit ? Asc.c_oAscRestrictionType.OnlyForms : this.appOptions.isPDFEdit ? Asc.c_oAscRestrictionType.None : Asc.c_oAscRestrictionType.View); + this.api.asc_setRestriction(this.appOptions.isRestrictedEdit ? Asc.c_oAscRestrictionType.OnlyForms : + this.appOptions.isPDFEdit || this.appOptions.isPDFAnnotate || this.appOptions.isPDFFill ? Asc.c_oAscRestrictionType.None : Asc.c_oAscRestrictionType.View); this.api.asc_LoadDocument(); }, + loadCoAuthSettingsPdf: function() { // in first version with co-editing set strict mode on start + Common.Utils.InternalSettings.set("pdfe-settings-coauthmode", false); + Common.Utils.InternalSettings.set("pdfe-settings-autosave", 0); + Common.Utils.InternalSettings.set("pdfe-settings-showchanges-fast", 'none'); + Common.Utils.InternalSettings.set("pdfe-settings-showchanges-strict", 'last'); + }, + loadCoAuthSettings: function() { var fastCoauth = true, autosave = 1, @@ -1524,11 +1537,11 @@ define([ onPdfModeCoAuthApply: function() { if (!this.api) return; - this._state.fastCoauth = (this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) && this.appOptions.canSaveToFile ? Common.Utils.InternalSettings.get("pdfe-settings-coauthmode") : this.appOptions.isForm; - // this.api.asc_SetFastCollaborative(this._state.fastCoauth); - // this.api.asc_setAutoSaveGap((this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) && this.appOptions.canSaveToFile ? Common.Utils.InternalSettings.get("pdfe-settings-autosave") : (this.appOptions.isForm ? 1 : 0)); - this.api.asc_SetFastCollaborative(true); - this.api.asc_setAutoSaveGap(1); + this._state.fastCoauth = (this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) && this.appOptions.canSaveToFile ? Common.Utils.InternalSettings.get("pdfe-settings-coauthmode") : + (this.appOptions.isPDFFill && this.appOptions.canSaveToFile || this.appOptions.isForm); + this.api.asc_SetFastCollaborative(this._state.fastCoauth); + this.api.asc_setAutoSaveGap((this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) && this.appOptions.canSaveToFile ? Common.Utils.InternalSettings.get("pdfe-settings-autosave") : + this.appOptions.isPDFFill && this.appOptions.canSaveToFile || this.appOptions.isForm ? 1 : 0); if ((this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) && this.appOptions.canSaveToFile) { var value = Common.Utils.InternalSettings.get((this._state.fastCoauth) ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict"); switch(value) { @@ -1603,7 +1616,8 @@ define([ me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); /** coauthoring begin **/ - me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); + if (me.appOptions.isPDFAnnotate || me.appOptions.isPDFEdit || me.appOptions.isPDFFill) + me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); me.appOptions.canSaveDocumentToBinary && me.api.asc_registerCallback('asc_onSaveDocument',_.bind(me.onSaveDocumentBinary, me)); /** coauthoring end **/ @@ -2305,19 +2319,20 @@ define([ if (!Common.localStorage.getBool("pdfe-hide-try-undoredo")) Common.UI.info({ width: 500, - msg: this.appOptions.canChangeCoAuthoring ? this.textTryUndoRedo : this.textTryUndoRedoWarn, + msg: this.appOptions.canChangeCoAuthoring && (this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) ? this.textTryUndoRedo : this.textTryUndoRedoWarn, iconCls: 'info', - buttons: this.appOptions.canChangeCoAuthoring ? [{value: 'custom', caption: this.textStrict}, 'cancel'] : ['ok'], - primary: this.appOptions.canChangeCoAuthoring ? 'custom' : 'ok', + buttons: this.appOptions.canChangeCoAuthoring && (this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) ? [{value: 'custom', caption: this.textStrict}, 'cancel'] : ['ok'], + primary: this.appOptions.canChangeCoAuthoring && (this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) ? 'custom' : 'ok', dontshow: true, callback: _.bind(function(btn, dontshow){ if (dontshow) Common.localStorage.setItem("pdfe-hide-try-undoredo", 1); if (btn == 'custom') { - Common.localStorage.setItem("pdfe-settings-coauthmode", 0); + // Common.localStorage.setItem("pdfe-settings-coauthmode", 0); Common.Utils.InternalSettings.set("pdfe-settings-coauthmode", false); this.api.asc_SetFastCollaborative(false); this._state.fastCoauth = false; - Common.localStorage.setItem("pdfe-settings-showchanges-strict", 'last'); + // Common.localStorage.setItem("pdfe-settings-showchanges-strict", 'last'); + Common.Utils.InternalSettings.set("pdfe-settings-showchanges-strict", 'last'); this.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.LastChanges); // this.getApplication().getController('Common.Controllers.ReviewChanges').applySettings(); } @@ -2358,7 +2373,7 @@ define([ if (this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) { if (this.appOptions.isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { var oldval = this._state.fastCoauth; - this._state.fastCoauth = Common.localStorage.getBool("pdfe-settings-coauthmode", true); + this._state.fastCoauth = Common.Utils.InternalSettings.get("pdfe-settings-coauthmode"); if (this._state.fastCoauth && !oldval) this.synchronizeChanges(); } diff --git a/apps/pdfeditor/main/app/controller/Toolbar.js b/apps/pdfeditor/main/app/controller/Toolbar.js index 6eb77c44c6..335ffffe42 100644 --- a/apps/pdfeditor/main/app/controller/Toolbar.js +++ b/apps/pdfeditor/main/app/controller/Toolbar.js @@ -223,7 +223,7 @@ define([ toolbar.btnAddComment.on('click', function (btn, e) { Common.NotificationCenter.trigger('app:comment:add', 'toolbar'); }); - toolbar.btnEditMode.on('click', function (btn, e) { + toolbar.btnEditMode && toolbar.btnEditMode.on('click', function (btn, e) { Common.NotificationCenter.trigger('pdf:mode-apply', btn.pressed ? 'edit' : 'comment'); }); Common.NotificationCenter.on('pdf:mode-changed', _.bind(this.changePDFMode, this)); @@ -712,10 +712,10 @@ define([ } }); } else if (this.api) { - // var isModified = this.api.asc_isDocumentCanSave(); - // var isSyncButton = toolbar.btnCollabChanges && toolbar.btnCollabChanges.cmpEl.hasClass('notify'); - // if (!isModified && !isSyncButton && !toolbar.mode.forcesave && !toolbar.mode.canSaveDocumentToBinary) - // return; + var isModified = this.api.asc_isDocumentCanSave(); + var isSyncButton = toolbar.btnCollabChanges && toolbar.btnCollabChanges.cmpEl.hasClass('notify'); + if (!isModified && !isSyncButton && !toolbar.mode.forcesave && !toolbar.mode.canSaveDocumentToBinary) + return; this.api.asc_Save(); toolbar.btnSave && toolbar.btnSave.setDisabled(!toolbar.mode.forcesave && toolbar.mode.canSaveToFile && !toolbar.mode.canSaveDocumentToBinary); @@ -1290,6 +1290,7 @@ define([ me.toolbar.setVisible('ins', true); } } + me.toolbar.setVisible('comment', config.isPDFAnnotate || config.isPDFEdit); }, applyMode: function() { diff --git a/apps/pdfeditor/main/app/view/FileMenuPanels.js b/apps/pdfeditor/main/app/view/FileMenuPanels.js index 48af2c2132..52988ad472 100644 --- a/apps/pdfeditor/main/app/view/FileMenuPanels.js +++ b/apps/pdfeditor/main/app/view/FileMenuPanels.js @@ -729,8 +729,8 @@ define([], function () { } /** coauthoring begin **/ $('tr.collaboration', this.el)[mode.canCoAuthoring && !mode.isForm || mode.canViewReview ? 'show' : 'hide'](); - $('tr.coauth.changes-mode', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring && canPDFSave ? 'show' : 'hide'](); - $('tr.coauth.changes-show', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && canPDFSave ? 'show' : 'hide'](); + $('tr.coauth.changes-mode', this.el)[mode.isEdit && mode.canCoAuthoring && mode.canChangeCoAuthoring && canPDFSave ? 'show' : 'hide'](); + $('tr.coauth.changes-show', this.el)[mode.isEdit && mode.canCoAuthoring && canPDFSave ? 'show' : 'hide'](); $('tr.comments', this.el)[mode.canCoAuthoring && !mode.isForm ? 'show' : 'hide'](); $('tr.ui-rtl', this.el)[mode.uiRtl ? 'show' : 'hide'](); /** coauthoring end **/ @@ -816,6 +816,7 @@ define([], function () { }, applySettings: function() { + var canPDFSave = (this.mode.isPDFAnnotate || this.mode.isPDFEdit) && this.mode.canSaveToFile && !this.mode.isOffline; Common.UI.Themes.setTheme(this.cmbTheme.getValue()); if (!this.chDarkMode.isDisabled() && (this.chDarkMode.isChecked() !== Common.UI.Themes.isContentThemeDark())) Common.UI.Themes.toggleContentTheme(); @@ -831,17 +832,23 @@ define([], function () { /** coauthoring begin **/ Common.Utils.InternalSettings.set("pdfe-settings-livecomment", this.chLiveComment.isChecked()); Common.Utils.InternalSettings.set("pdfe-settings-resolvedcomment", this.chResolvedComment.isChecked()); - if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { - this.mode.canChangeCoAuthoring && Common.localStorage.setItem("pdfe-settings-coauthmode", this.rbCoAuthModeFast.getValue() ? 1 : 0 ); - Common.localStorage.setItem(this.rbCoAuthModeFast.getValue() ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict", - this.rbShowChangesNone.getValue()?'none':this.rbShowChangesLast.getValue()?'last':'all'); + if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring && canPDFSave) { + // in first version with co-editing don't save co-editing mode to local storate + // this.mode.canChangeCoAuthoring && Common.localStorage.setItem("pdfe-settings-coauthmode", this.rbCoAuthModeFast.getValue() ? 1 : 0 ); + // Common.localStorage.setItem(this.rbCoAuthModeFast.getValue() ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict", + // this.rbShowChangesNone.getValue()?'none':this.rbShowChangesLast.getValue()?'last':'all'); + this.mode.canChangeCoAuthoring && Common.Utils.InternalSettings.set("pdfe-settings-coauthmode", !!this.rbCoAuthModeFast.getValue()); + Common.Utils.InternalSettings.set(this.rbCoAuthModeFast.getValue() ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict", + this.rbShowChangesNone.getValue()?'none':this.rbShowChangesLast.getValue()?'last':'all'); } /** coauthoring end **/ Common.localStorage.setItem("pdfe-settings-fontrender", this.cmbFontRender.getValue()); var item = this.cmbFontRender.store.findWhere({value: 'custom'}); Common.localStorage.setItem("pdfe-settings-cachemode", item && !item.get('checked') ? 0 : 1); - if (this.mode.isEdit && (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("pdfe-settings-coauthmode"))) - Common.localStorage.setItem("pdfe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); + if (this.mode.isEdit && (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("pdfe-settings-coauthmode"))) { + Common.Utils.InternalSettings.set("pdfe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); + // Common.localStorage.setItem("pdfe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); + } if (this.mode.canForcesave) Common.localStorage.setItem("pdfe-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); diff --git a/apps/pdfeditor/main/app/view/Toolbar.js b/apps/pdfeditor/main/app/view/Toolbar.js index 2f1c98aa9a..9e04b76f6b 100644 --- a/apps/pdfeditor/main/app/view/Toolbar.js +++ b/apps/pdfeditor/main/app/view/Toolbar.js @@ -885,18 +885,20 @@ define([ }); this.btnsHighlight = [this.btnHighlight]; - this.btnEditMode = new Common.UI.Button({ - cls: 'btn-toolbar x-huge icon-top', - iconCls: 'toolbar__icon btn-edit-text', - style: 'min-width: 45px;', - lock: [_set.lostConnect, _set.disableOnStart], - caption: this.textEditMode, - enableToggle: true, - dataHint: '1', - dataHintDirection: 'bottom', - dataHintOffset: 'small' - }); - this.toolbarControls.push(this.btnEditMode); + if (config.isPDFAnnotate && config.canPDFEdit || config.isPDFEdit) { + this.btnEditMode = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-edit-text', + style: 'min-width: 45px;', + lock: [_set.lostConnect, _set.disableOnStart], + caption: this.textEditMode, + enableToggle: true, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.toolbarControls.push(this.btnEditMode); + } config.isPDFEdit && this.applyLayoutPDFEdit(config); } else if ( config.isRestrictedEdit ) { @@ -1284,7 +1286,7 @@ define([ _injectComponent('#slot-btn-underline', this.btnUnderline); _injectComponent('#slot-btn-highlight', this.btnHighlight); _injectComponent('#slot-btn-text-comment', this.btnTextComment); - _injectComponent('#slot-btn-tb-edit-mode', this.btnEditMode); + this.btnEditMode ? _injectComponent('#slot-btn-tb-edit-mode', this.btnEditMode) : $host.findById('#slot-btn-tb-edit-mode').parents('.group').hide().next('.separator').hide(); }, rendererComponentsCommon: function($host) { @@ -1478,7 +1480,7 @@ define([ this.btnHighlight.updateHint(this.textHighlight); // this.btnTextComment.updateHint([this.tipInsertTextComment, this.tipInsertText]); this.btnTextComment.updateHint(this.tipInsertTextComment); - this.btnEditMode.updateHint(this.tipEditMode); + this.btnEditMode && this.btnEditMode.updateHint(this.tipEditMode); }, createDelayedElementsPDFEdit: function() { @@ -1683,6 +1685,8 @@ define([ /** coauthoring begin **/ onCollaborativeChanges: function () { + if (!(this.mode.isPDFAnnotate || this.mode.isPDFEdit)) return; + if (this._state.hasCollaborativeChanges) return; if (!this.btnCollabChanges.rendered || this._state.previewmode) { this.needShowSynchTip = true; @@ -1741,6 +1745,8 @@ define([ }, onApiUsersChanged: function (users) { + if (!(this.mode.isPDFAnnotate || this.mode.isPDFEdit)) return; + var editusers = []; _.each(users, function (item) { if (!item.asc_getView())