From db07317d293cbf813f82ff78c8ce77acf8db62fa Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 15 Apr 2022 16:37:38 +0300 Subject: [PATCH] [DE] Fix Bug 55351 --- apps/documenteditor/main/app/controller/Main.js | 2 +- apps/documenteditor/main/app/controller/Navigation.js | 8 ++++++-- apps/documenteditor/main/app/view/Navigation.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index cbef73f27..06d67ec8a 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1224,7 +1224,7 @@ define([ leftmenuController.getView('LeftMenu').getMenu('file').loadDocument({doc:me.document}); leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api); - navigationController.setApi(me.api).setMode(this.appOptions); + navigationController.setMode(me.appOptions).setApi(me.api); chatController.setApi(this.api).setMode(this.appOptions); application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization}); diff --git a/apps/documenteditor/main/app/controller/Navigation.js b/apps/documenteditor/main/app/controller/Navigation.js index bbb09fca9..fa2f2b980 100644 --- a/apps/documenteditor/main/app/controller/Navigation.js +++ b/apps/documenteditor/main/app/controller/Navigation.js @@ -65,6 +65,8 @@ define([ if (me.panelNavigation && me.panelNavigation.viewNavigationList && me.panelNavigation.viewNavigationList.scroller) me.panelNavigation.viewNavigationList.scroller.update({alwaysVisibleY: true}); } + if (!me.mode.isEdit && !me.mode.isRestrictedEdit) + me.panelNavigation.viewNavigationList.focus(); }, 'hide': function() { if (!this.canUseViwerNavigation) { @@ -103,8 +105,10 @@ define([ setMode: function(mode) { this.mode = mode; this.canUseViwerNavigation = this.mode.canUseViwerNavigation; - if (this.panelNavigation && this.panelNavigation.viewNavigationList) + if (this.panelNavigation && this.panelNavigation.viewNavigationList) { this.panelNavigation.viewNavigationList.setEmptyText(this.mode.isEdit ? this.panelNavigation.txtEmpty : this.panelNavigation.txtEmptyViewer); + this.panelNavigation.viewNavigationList.enableKeyEvents = !this.mode.isEdit && !this.mode.isRestrictedEdit; + } return this; }, @@ -232,7 +236,7 @@ define([ } else if (this._viewerNavigationObject) { this.api.asc_viewerNavigateTo(record.get('index')); } - Common.NotificationCenter.trigger('edit:complete', this.panelNavigation); + (this.mode.isEdit || this.mode.isRestrictedEdit) && Common.NotificationCenter.trigger('edit:complete', this.panelNavigation); }, onItemAdd: function(picker, item, record, e){ diff --git a/apps/documenteditor/main/app/view/Navigation.js b/apps/documenteditor/main/app/view/Navigation.js index ec57446e8..dd1a396b1 100644 --- a/apps/documenteditor/main/app/view/Navigation.js +++ b/apps/documenteditor/main/app/view/Navigation.js @@ -68,7 +68,7 @@ define([ this.viewNavigationList = new Common.UI.TreeView({ el: $('#navigation-list'), store: this.storeNavigation, - enableKeyEvents: true, + enableKeyEvents: false, emptyText: this.txtEmpty, emptyItemText: this.txtEmptyItem, style: 'border: none;',