From b4991432a59ebcee0718c602a9e7fc4163af20e1 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 17 Sep 2021 22:59:02 +0300 Subject: [PATCH] Fix focus in multilevel menu --- apps/common/main/lib/component/Menu.js | 2 ++ apps/common/main/lib/component/ThemeColorPalette.js | 1 + apps/documenteditor/main/app/view/Toolbar.js | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index 043276199..94c1fbf4d 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -502,6 +502,8 @@ define([ } Common.UI.Menu.Manager.hideAll(); } else if (e.namespace!=="after.bs.dropdown" && (e.keyCode == Common.UI.Keys.DOWN || e.keyCode == Common.UI.Keys.UP)) { + if ( this.menuRoot.length<1 || $(e.target).closest('ul[role=menu]').get(0) !== this.menuRoot.get(0)) return; + var innerMenu = this.findInnerMenu(e.keyCode); if (innerMenu && innerMenu.focusInner) { e.preventDefault(); diff --git a/apps/common/main/lib/component/ThemeColorPalette.js b/apps/common/main/lib/component/ThemeColorPalette.js index dfefb3980..770dc4231 100644 --- a/apps/common/main/lib/component/ThemeColorPalette.js +++ b/apps/common/main/lib/component/ThemeColorPalette.js @@ -105,6 +105,7 @@ define([ this.colors = me.options.colors || this.generateColorData(me.options.themecolors, me.options.effects, me.options.standardcolors, me.options.transparent); this.enableKeyEvents= me.options.enableKeyEvents; this.tabindex = me.options.tabindex || 0; + this.outerMenu = me.options.outerMenu; this.lastSelectedIdx = -1; me.colorItems = []; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 8f2f7aa51..6050cf629 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -2171,8 +2171,10 @@ define([ '808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966', '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF' - ] + ], + outerMenu: {menu: this.mnuHighlightControls, index: 2} }); + this.mnuHighlightControls.setInnerMenu([{menu: this.mnuControlsColorPicker, index: 2}]); } },