Bug 31874, 31657, 31876
This commit is contained in:
parent
748168de53
commit
3c747fa342
|
@ -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([
|
||||||
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([
|
||||||
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,
|
||||||
|
@ -1340,12 +1337,19 @@ define([
|
||||||
}
|
}
|
||||||
} else if (e.keyCode == Common.UI.Keys.TAB)
|
} else if (e.keyCode == Common.UI.Keys.TAB)
|
||||||
li = $(e.target).closest('li');
|
li = $(e.target).closest('li');
|
||||||
|
|
||||||
if (li) {
|
if (li) {
|
||||||
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([
|
||||||
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([
|
||||||
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]);
|
||||||
|
|
Loading…
Reference in a new issue