Commit 3c747fa3 authored by Julia Radzhabova's avatar Julia Radzhabova

Bug 31874, 31657, 31876

parent 748168de
...@@ -16,12 +16,12 @@ function onDropDownKeyDown(e) { ...@@ -16,12 +16,12 @@ function onDropDownKeyDown(e) {
if ($parent.hasClass('no-stop-propagate') && arguments.length>1 && arguments[1] instanceof jQuery.Event) { if ($parent.hasClass('no-stop-propagate') && arguments.length>1 && arguments[1] instanceof jQuery.Event) {
e = arguments[1]; e = arguments[1];
if ( /^(38|40|27|13|9)$/.test(e.keyCode)) { if ( /^(38|40|27|13|9)$/.test(e.keyCode) && !e.ctrlKey && !e.altKey) {
patchDropDownKeyDownAdditional.call(this, e); patchDropDownKeyDownAdditional.call(this, e);
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
} }
} else if ( !$parent.hasClass('no-stop-propagate') || /^(38|40|27|13|9)$/.test(e.keyCode)) { } else if ( !$parent.hasClass('no-stop-propagate') || /^(38|40|27|13|9)$/.test(e.keyCode) && !e.ctrlKey && !e.altKey) {
patchDropDownKeyDown.call(this, e); patchDropDownKeyDown.call(this, e);
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
......
...@@ -1303,9 +1303,6 @@ define([ ...@@ -1303,9 +1303,6 @@ define([
menu.addItem(mnu); menu.addItem(mnu);
}); });
Common.UI.Menu.Manager.hideAll();
if (!menu.rendered) { if (!menu.rendered) {
// Prepare menu container // Prepare menu container
if (menuContainer.length < 1) { if (menuContainer.length < 1) {
...@@ -1313,15 +1310,15 @@ define([ ...@@ -1313,15 +1310,15 @@ define([
documentHolderView.cmpEl.append(menuContainer); documentHolderView.cmpEl.append(menuContainer);
} }
menu.render(menuContainer); menu.onAfterKeydownMenu = function(e) {
menu.cmpEl.attr({tabindex: "-1"}); if (e.keyCode == Common.UI.Keys.RETURN && (e.ctrlKey || e.altKey)) return;
Common.UI.Menu.prototype.onAfterKeydownMenu.call(menu, e);
menu.parentEl.on('keydown.after.bs.dropdown', _.bind(function(e) {
var li; var li;
if (arguments.length>1 && arguments[1] instanceof jQuery.Event) {// when typing in cell editor if (arguments.length>1 && arguments[1] instanceof jQuery.Event) {// when typing in cell editor
e = arguments[1]; e = arguments[1];
if (menuContainer.hasClass('open')) { if (menuContainer.hasClass('open')) {
if (e.keyCode == Common.UI.Keys.TAB || e.keyCode == Common.UI.Keys.RETURN) if (e.keyCode == Common.UI.Keys.TAB || e.keyCode == Common.UI.Keys.RETURN && !e.ctrlKey && !e.altKey)
li = menuContainer.find('a.focus').closest('li'); li = menuContainer.find('a.focus').closest('li');
else if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) { else if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) {
var innerEl = menu.cmpEl, var innerEl = menu.cmpEl,
...@@ -1345,7 +1342,14 @@ define([ ...@@ -1345,7 +1342,14 @@ define([
if (li.length>0) li.click(); if (li.length>0) li.click();
Common.UI.Menu.Manager.hideAll(); Common.UI.Menu.Manager.hideAll();
} }
}, me)); };
menu.render(menuContainer);
menu.cmpEl.attr({tabindex: "-1"});
menu.on('hide:after', function() {
if (Common.Utils.isIE) me.documentHolder.focus();
});
} }
var coord = me.api.asc_getActiveCellCoord(), var coord = me.api.asc_getActiveCellCoord(),
...@@ -1355,9 +1359,14 @@ define([ ...@@ -1355,9 +1359,14 @@ define([
menu.alignPosition(); menu.alignPosition();
var infocus = me.cellEditor.is(":focus"); var infocus = me.cellEditor.is(":focus");
if (!menu.isVisible())
Common.UI.Menu.Manager.hideAll();
_.delay(function() { _.delay(function() {
menu.show(); if (!menu.isVisible()) menu.show();
if (menu.scroller) menu.scroller.scrollTop(0); if (menu.scroller) {
menu.scroller.update({alwaysVisibleY: true});
menu.scroller.scrollTop(0);
}
if (infocus) { if (infocus) {
me.cellEditor.focus(); me.cellEditor.focus();
_.delay(function() { _.delay(function() {
......
...@@ -482,8 +482,6 @@ define([ ...@@ -482,8 +482,6 @@ define([
minScrollbarLength : 40, minScrollbarLength : 40,
alwaysVisibleY: true alwaysVisibleY: true
}); });
}).on('show:after', function () {
this.scroller.update({alwaysVisibleY: true});
}); });
me.fireEvent('createdelayedelements', [me]); me.fireEvent('createdelayedelements', [me]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment