Merge pull request #1701 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2022-04-15 16:44:46 +03:00 committed by GitHub
commit 5134413258
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -1224,7 +1224,7 @@ define([
leftmenuController.getView('LeftMenu').getMenu('file').loadDocument({doc:me.document}); leftmenuController.getView('LeftMenu').getMenu('file').loadDocument({doc:me.document});
leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api); 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); chatController.setApi(this.api).setMode(this.appOptions);
application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization}); application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});

View file

@ -65,6 +65,8 @@ define([
if (me.panelNavigation && me.panelNavigation.viewNavigationList && me.panelNavigation.viewNavigationList.scroller) if (me.panelNavigation && me.panelNavigation.viewNavigationList && me.panelNavigation.viewNavigationList.scroller)
me.panelNavigation.viewNavigationList.scroller.update({alwaysVisibleY: true}); me.panelNavigation.viewNavigationList.scroller.update({alwaysVisibleY: true});
} }
if (!me.mode.isEdit && !me.mode.isRestrictedEdit)
me.panelNavigation.viewNavigationList.focus();
}, },
'hide': function() { 'hide': function() {
if (!this.canUseViwerNavigation) { if (!this.canUseViwerNavigation) {
@ -103,8 +105,10 @@ define([
setMode: function(mode) { setMode: function(mode) {
this.mode = mode; this.mode = mode;
this.canUseViwerNavigation = this.mode.canUseViwerNavigation; 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.setEmptyText(this.mode.isEdit ? this.panelNavigation.txtEmpty : this.panelNavigation.txtEmptyViewer);
this.panelNavigation.viewNavigationList.enableKeyEvents = !this.mode.isEdit && !this.mode.isRestrictedEdit;
}
return this; return this;
}, },
@ -232,7 +236,7 @@ define([
} else if (this._viewerNavigationObject) { } else if (this._viewerNavigationObject) {
this.api.asc_viewerNavigateTo(record.get('index')); 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){ onItemAdd: function(picker, item, record, e){