From 094cb9989b3ed3c5bab532932d425dcf4a83eacb Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Mon, 4 Jul 2022 11:45:40 +0300 Subject: [PATCH] [DE] Bug 57756 --- apps/common/main/lib/controller/HintManager.js | 11 ++++++----- apps/common/main/lib/mods/perfect-scrollbar.js | 8 ++++++-- apps/documenteditor/main/app/view/FileMenuPanels.js | 12 +++++------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/apps/common/main/lib/controller/HintManager.js b/apps/common/main/lib/controller/HintManager.js index c8263e7c4..8a2f3e667 100644 --- a/apps/common/main/lib/controller/HintManager.js +++ b/apps/common/main/lib/controller/HintManager.js @@ -464,11 +464,8 @@ Common.UI.HintManager = new(function() { $(document).on('keyup', function(e) { if (_isScroll && (e.keyCode === Common.UI.Keys.UP || e.keyCode === Common.UI.Keys.DOWN)) { _isScroll = false; - _hideHints(); - _currentHints.length = 0; - _currentControls.length = 0; _showHints(); - console.log($(':focus')); + Common.NotificationCenter.trigger('hints:hover', false); } else if (e.keyCode == Common.UI.Keys.ALT && _needShow && !(window.SSE && window.SSE.getController('Statusbar').getIsDragDrop())) { e.preventDefault(); if (!_hintVisible) { @@ -492,8 +489,12 @@ Common.UI.HintManager = new(function() { $(document).on('keydown', function(e) { if (_hintVisible) { e.preventDefault(); - if (e.keyCode === Common.UI.Keys.UP || e.keyCode === Common.UI.Keys.DOWN) { + if ($('#file-menu-panel').is(':visible') && _currentLevel === 2 && (e.keyCode === Common.UI.Keys.UP || e.keyCode === Common.UI.Keys.DOWN)) { + _hideHints(); + _currentHints.length = 0; + _currentControls.length = 0; _isScroll = true; + Common.NotificationCenter.trigger('hints:hover', true); } else if (e.keyCode == Common.UI.Keys.ESC ) { setTimeout(function () { if (_currentLevel === 0) { diff --git a/apps/common/main/lib/mods/perfect-scrollbar.js b/apps/common/main/lib/mods/perfect-scrollbar.js index e81b30fdc..3d97204b6 100644 --- a/apps/common/main/lib/mods/perfect-scrollbar.js +++ b/apps/common/main/lib/mods/perfect-scrollbar.js @@ -386,17 +386,21 @@ }; var bindKeyboardHandler = function () { - var hovered = false; + var hovered = false, + altHovered = false; $this.bind('mouseenter' + eventClassName, function (e) { hovered = true; }); $this.bind('mouseleave' + eventClassName, function (e) { hovered = false; }); + Common.NotificationCenter.on('hints:hover', function (isHover) { + altHovered = isHover; + }); var shouldPrevent = false; $(document).bind('keydown' + eventClassName, function (e) { - if (!hovered || $(document.activeElement).is(":input,[contenteditable]")) { + if ((!hovered && !altHovered) || $(document.activeElement).is(":input,[contenteditable]")) { return; } diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index feff55755..6841e2e91 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -246,8 +246,8 @@ define([ menu: undefined, template: _.template([ - '
', - '', + '
', + '
', '', '', '', @@ -739,11 +739,9 @@ define([ this.updateSettings(); this.updateScroller(); - var me = this; - setTimeout(function () { - $(me.el).find('.ps-container table')[0].focus(); - console.log($(':focus')); - }, 300); + setTimeout(_.bind(function () { + $(this.el).find('.ps-container')[0].focus(); + }, this), 10); }, updateScroller: function() {