Compare commits

...

3 commits

Author SHA1 Message Date
JuliaSvinareva c259b8e57b [DE] Bug 57756 2022-07-06 16:25:41 +03:00
JuliaSvinareva 094cb9989b [DE] Bug 57756 2022-07-04 11:45:40 +03:00
JuliaSvinareva 0d333bffc8 [DE] Bug 57756 2022-06-29 15:49:30 +03:00
6 changed files with 51 additions and 18 deletions

View file

@ -118,7 +118,8 @@ Common.UI.HintManager = new(function() {
_isDocReady = false,
_isEditDiagram = false,
_usedTitles = [],
_appPrefix;
_appPrefix,
_isScroll = false;
var _api;
@ -461,7 +462,11 @@ Common.UI.HintManager = new(function() {
_clearHints();
});
$(document).on('keyup', function(e) {
if (e.keyCode == Common.UI.Keys.ALT && _needShow && !(window.SSE && window.SSE.getController('Statusbar').getIsDragDrop())) {
if (_isScroll && (e.keyCode === Common.UI.Keys.UP || e.keyCode === Common.UI.Keys.DOWN)) {
_isScroll = false;
_showHints();
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) {
$('input:focus').blur(); // to change value in inputField
@ -484,7 +489,13 @@ Common.UI.HintManager = new(function() {
$(document).on('keydown', function(e) {
if (_hintVisible) {
e.preventDefault();
if (e.keyCode == Common.UI.Keys.ESC ) {
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, _currentLevel);
} else if (e.keyCode == Common.UI.Keys.ESC ) {
setTimeout(function () {
if (_currentLevel === 0) {
_hideHints();
@ -659,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

@ -386,17 +386,28 @@
};
var bindKeyboardHandler = function () {
var hovered = false;
var hovered = 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;
});
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) {
if (!hovered || $(document.activeElement).is(":input,[contenteditable]")) {
if ((!hovered && !altHovered) || $(document.activeElement).is(":input,[contenteditable]")) {
return;
}

View file

@ -680,6 +680,8 @@ define([
menuFilesShowHide: function(state) {
if (this.api && state == 'hide')
this.api.asc_enableKeyEvents(true);
else
this.api.asc_enableKeyEvents(false);
},
onMenuChange: function (value) {

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">',
'<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>',
@ -1175,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>',