Skip to content

Commit

Permalink
Merge pull request 'fix/bugfix' (#105) from fix/bugfix into hotfix/v8…
Browse files Browse the repository at this point in the history
….2.1
  • Loading branch information
Julia Radzhabova committed Oct 29, 2024
2 parents 31ddcf2 + f4bb2eb commit c300b4e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
15 changes: 9 additions & 6 deletions apps/common/main/lib/component/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ define([
this.onResetItems();
},

openMenu: function(delay) {
openMenu: function(delay, callback) {
if (this.store.length<1) return;

var me = this;
Expand All @@ -291,6 +291,7 @@ define([

_.delay(function(){
me.cmpEl.addClass('open');
callback && callback();
}, delay || 0);
},

Expand Down Expand Up @@ -442,10 +443,12 @@ define([
},

onAfterKeydownMenu: function(e) {
var me = this;
if (e.keyCode == Common.UI.Keys.DOWN && !this.editable && !this.isMenuOpen()) {
this.onBeforeShowMenu();
this.openMenu();
this.onAfterShowMenu();
this.openMenu(0, function() {
me.onAfterShowMenu();
});
return false;
} else if (!this.focusWhenNoSelection && (e.keyCode == Common.UI.Keys.DOWN || e.keyCode == Common.UI.Keys.UP)) {
var $items = this.cmpEl.find('ul > li a');
Expand All @@ -471,7 +474,6 @@ define([
} else if (this.search && e.keyCode > 64 && e.keyCode < 91 && e.key){
if (typeof this._search !== 'object') return;

var me = this;
clearTimeout(this._search.timer);
this._search.timer = setTimeout(function () { me._search = {}; }, 1000);

Expand Down Expand Up @@ -548,8 +550,9 @@ define([
this.onAfterHideMenu(e);
} else if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) {
if (!this.isMenuOpen()) {
this.openMenu();
this.onAfterShowMenu();
this.openMenu(0, function() {
me.onAfterShowMenu();
});
}

_.delay(function() {
Expand Down
9 changes: 7 additions & 2 deletions apps/common/main/lib/controller/ScreenReaderFocus.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ Common.UI.ScreenReaderFocusManager = new(function() {
_isEditDiagram = false,
_isSidePanelMode = false,
_api,
_app;
_app,
_appPrefix;

var _setCurrentSection = function (btn, section) {
_lastSection = _currentSection;
Expand Down Expand Up @@ -268,6 +269,9 @@ Common.UI.ScreenReaderFocusManager = new(function() {
_app = window.DE || window.PE || window.SSE || window.PDFE;
_isDocReady = true;

var filter = Common.localStorage.getKeysFilter();
_appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';

if ( !Common.Utils.ScreeenReaderHelper ) {
require(['common/main/lib/util/ScreenReaderHelper'], function () {
Common.Utils.ScreeenReaderHelper.setEnabled(true);
Expand Down Expand Up @@ -399,7 +403,8 @@ Common.UI.ScreenReaderFocusManager = new(function() {
}
});
$(document).on('keydown', function(e) {
_needShow = e.keyCode == Common.UI.Keys.ALT && !e.shiftKey && !Common.Utils.ModalWindow.isVisible() && _isDocReady && !(window.PE && $('#pe-preview').is(':visible'));
_needShow = Common.Utils.InternalSettings.get(_appPrefix + "settings-show-alt-hints") && e.keyCode == Common.UI.Keys.ALT && !e.shiftKey &&
!Common.Utils.ModalWindow.isVisible() && _isDocReady && !(window.PE && $('#pe-preview').is(':visible'));

// Add outline style for focus elements for test
if (Common.localStorage.getBool('screen-reader-focus-mode', false)) {
Expand Down
3 changes: 2 additions & 1 deletion apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2901,11 +2901,12 @@ define([
documentHolder.pmiFilterCells.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && !inPivot);
documentHolder.pmiReapply.setVisible((iscellmenu||isallmenu) && !iscelledit && !diagramOrMergeEditor && !inPivot);
documentHolder.pmiCondFormat.setVisible(!iscelledit && !diagramOrMergeEditor);
documentHolder.pmiCellSeparator.setVisible((iscellmenu||isallmenu||isinsparkline) && !iscelledit);

documentHolder.pmiInsFunction.setVisible(iscellmenu && !iscelledit && !inPivot);
documentHolder.pmiAddNamedRange.setVisible(iscellmenu && !iscelledit && !internaleditor);

var needshow = iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot;
documentHolder.pmiCellSeparator.setVisible((iscellmenu||isallmenu||isinsparkline) && !iscelledit && !inPivot || needshow);

needshow && this.fillPivotProps();
documentHolder.mnuRefreshPivot.setVisible(needshow);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ define([], function () {
this.cmbUser.setRawValue(str);

if (arr.length>0)
this.cmbUser.openMenu()
this.cmbUser.openMenu();
else {
this.cmbUser.closeMenu();
this.cmbUser.focus();
Expand Down

0 comments on commit c300b4e

Please sign in to comment.