[DE] Bug 57756

This commit is contained in:
JuliaSvinareva 2022-07-06 16:25:41 +03:00
parent 094cb9989b
commit c259b8e57b
5 changed files with 36 additions and 24 deletions

View file

@ -465,7 +465,7 @@ Common.UI.HintManager = new(function() {
if (_isScroll && (e.keyCode === Common.UI.Keys.UP || e.keyCode === Common.UI.Keys.DOWN)) {
_isScroll = false;
_showHints();
Common.NotificationCenter.trigger('hints:hover', false);
Common.NotificationCenter.trigger('hints:hover', false, _currentLevel);
} else if (e.keyCode == Common.UI.Keys.ALT && _needShow && !(window.SSE && window.SSE.getController('Statusbar').getIsDragDrop())) {
e.preventDefault();
if (!_hintVisible) {
@ -489,12 +489,12 @@ Common.UI.HintManager = new(function() {
$(document).on('keydown', function(e) {
if (_hintVisible) {
e.preventDefault();
if ($('#file-menu-panel').is(':visible') && _currentLevel === 2 && (e.keyCode === Common.UI.Keys.UP || e.keyCode === Common.UI.Keys.DOWN)) {
if ($('#file-menu-panel').is(':visible') && (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);
Common.NotificationCenter.trigger('hints:hover', true, _currentLevel);
} else if (e.keyCode == Common.UI.Keys.ESC ) {
setTimeout(function () {
if (_currentLevel === 0) {
@ -670,11 +670,16 @@ Common.UI.HintManager = new(function() {
_isEditDiagram = mode.isEditDiagram || mode.isEditMailMerge || mode.isEditOle;
};
var _isHovered = function () {
return ($('#file-menu-panel').is(':visible') && (_hintVisible || _isScroll));
};
return {
init: _init,
setMode: _setMode,
clearHints: _clearHints,
needCloseFileMenu: _needCloseFileMenu,
isHintVisible: _isHintVisible
isHintVisible: _isHintVisible,
isHovered: _isHovered
}
})();

View file

@ -387,16 +387,23 @@
var bindKeyboardHandler = function () {
var hovered = false,
altHovered = false;
altHovered = false,
altLevel = $this.data('hint-container');
$this.bind('mouseenter' + eventClassName, function (e) {
if (Common.UI.HintManager.isHovered()) return;
hovered = true;
});
$this.bind('mouseleave' + eventClassName, function (e) {
if (Common.UI.HintManager.isHovered()) return;
hovered = false;
});
Common.NotificationCenter.on('hints:hover', function (isHover) {
altHovered = isHover;
});
if (altLevel !== undefined) {
Common.NotificationCenter.on('hints:hover', function (isHover, level) {
if (level === parseInt(altLevel)) {
altHovered = isHover;
}
});
}
var shouldPrevent = false;
$(document).bind('keydown' + eventClassName, function (e) {

View file

@ -1,4 +1,4 @@
<div class="panel-menu">
<div class="panel-menu" tabindex="0" data-hint-container="1">
<li class="fm-first-item"></li>
<li id="fm-btn-return" class="fm-btn" data-layout-name="toolbar-file-close"></li>
<li class="devider"></li>
@ -25,13 +25,13 @@
<li id="fm-btn-back" class="fm-btn"></li>
</div>
<div class="panel-context">
<div id="panel-saveas" class="content-box"></div>
<div id="panel-savecopy" class="content-box"></div>
<div id="panel-recentfiles" class="content-box"></div>
<div id="panel-createnew" class="content-box"></div>
<div id="panel-info" class="content-box"></div>
<div id="panel-rights" class="content-box"></div>
<div id="panel-settings" class="content-box"></div>
<div id="panel-help" class="content-box"></div>
<div id="panel-protect" class="content-box"></div>
<div id="panel-saveas" class="content-box" data-hint-container="2"></div>
<div id="panel-savecopy" class="content-box" data-hint-container="2"></div>
<div id="panel-recentfiles" class="content-box" data-hint-container="2"></div>
<div id="panel-createnew" class="content-box" data-hint-container="2"></div>
<div id="panel-info" class="content-box" data-hint-container="2"></div>
<div id="panel-rights" class="content-box" data-hint-container="2"></div>
<div id="panel-settings" class="content-box" data-hint-container="2"></div>
<div id="panel-help" class="content-box" data-hint-container="2"></div>
<div id="panel-protect" class="content-box" data-hint-container="2"></div>
</div>

View file

@ -337,6 +337,10 @@ define([
this.api.asc_enableKeyEvents(false);
this.fireEvent('menu:show', [this]);
setTimeout(_.bind(function () {
this.$el.find('.panel-menu')[0].focus();
}, this), 10);
},
hide: function() {

View file

@ -246,7 +246,7 @@ define([
menu: undefined,
template: _.template([
'<div class="flex-settings" tabindex="0">',
'<div class="flex-settings" data-hint-container="2">',
'<table style="margin: 10px 14px 0;"><tbody>',
'<tr class="editsave">',
'<td colspan="2" class="group-name top"><label><%= scope.txtEditingSaving %></label></td>',
@ -738,10 +738,6 @@ define([
this.updateSettings();
this.updateScroller();
setTimeout(_.bind(function () {
$(this.el).find('.ps-container')[0].focus();
}, this), 10);
},
updateScroller: function() {
@ -1179,7 +1175,7 @@ define([
this.rendered = false;
this.template = _.template([
'<div class="flex-settings">',
'<div class="flex-settings" data-hint-container="2">',
'<table class="main" style="margin: 30px 0 0;">',
'<tr>',
'<td class="left"><label>' + this.txtPlacement + '</label></td>',