Merge pull request #1169 from ONLYOFFICE/feature/sse-func-menu
[SSE] Change position func menu when cell editor is focused
This commit is contained in:
commit
f6107e516e
|
@ -2501,12 +2501,20 @@ define([
|
||||||
menu.cmpEl.attr({tabindex: "-1"});
|
menu.cmpEl.attr({tabindex: "-1"});
|
||||||
}
|
}
|
||||||
|
|
||||||
var coord = me.api.asc_getActiveCellCoord(),
|
var infocus = me.cellEditor.is(":focus");
|
||||||
showPoint = [coord.asc_getX() + (offset ? offset[0] : 0), (coord.asc_getY() < 0 ? 0 : coord.asc_getY()) + coord.asc_getHeight() + (offset ? offset[1] : 0)];
|
|
||||||
menuContainer.css({left: showPoint[0], top : showPoint[1]});
|
if (infocus) {
|
||||||
|
menu.menuAlignEl = me.cellEditor;
|
||||||
|
me.focusInCellEditor = true;
|
||||||
|
} else {
|
||||||
|
menu.menuAlignEl = undefined;
|
||||||
|
me.focusInCellEditor = false;
|
||||||
|
var coord = me.api.asc_getActiveCellCoord(),
|
||||||
|
showPoint = [coord.asc_getX() + (offset ? offset[0] : 0), (coord.asc_getY() < 0 ? 0 : coord.asc_getY()) + coord.asc_getHeight() + (offset ? offset[1] : 0)];
|
||||||
|
menuContainer.css({left: showPoint[0], top : showPoint[1]});
|
||||||
|
}
|
||||||
menu.alignPosition();
|
menu.alignPosition();
|
||||||
|
|
||||||
var infocus = me.cellEditor.is(":focus");
|
|
||||||
if (!menu.isVisible())
|
if (!menu.isVisible())
|
||||||
Common.UI.Menu.Manager.hideAll();
|
Common.UI.Menu.Manager.hideAll();
|
||||||
_.delay(function() {
|
_.delay(function() {
|
||||||
|
@ -2571,12 +2579,19 @@ define([
|
||||||
functip.isHidden = false;
|
functip.isHidden = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var pos = [
|
var infocus = this.cellEditor.is(":focus"),
|
||||||
this.documentHolder.cmpEl.offset().left - $(window).scrollLeft(),
|
showPoint;
|
||||||
this.documentHolder.cmpEl.offset().top - $(window).scrollTop()
|
if (infocus || this.focusInCellEditor) {
|
||||||
],
|
var offset = this.cellEditor.offset();
|
||||||
coord = this.api.asc_getActiveCellCoord(),
|
showPoint = [offset.left, offset.top + this.cellEditor.height() + 3];
|
||||||
|
} else {
|
||||||
|
var pos = [
|
||||||
|
this.documentHolder.cmpEl.offset().left - $(window).scrollLeft(),
|
||||||
|
this.documentHolder.cmpEl.offset().top - $(window).scrollTop()
|
||||||
|
],
|
||||||
|
coord = this.api.asc_getActiveCellCoord();
|
||||||
showPoint = [coord.asc_getX() + pos[0] - 3, coord.asc_getY() + pos[1] - functip.ref.getBSTip().$tip.height() - 5];
|
showPoint = [coord.asc_getX() + pos[0] - 3, coord.asc_getY() + pos[1] - functip.ref.getBSTip().$tip.height() - 5];
|
||||||
|
}
|
||||||
var tipwidth = functip.ref.getBSTip().$tip.width();
|
var tipwidth = functip.ref.getBSTip().$tip.width();
|
||||||
if (showPoint[0] + tipwidth > this.tooltips.coauth.bodyWidth )
|
if (showPoint[0] + tipwidth > this.tooltips.coauth.bodyWidth )
|
||||||
showPoint[0] = this.tooltips.coauth.bodyWidth - tipwidth;
|
showPoint[0] = this.tooltips.coauth.bodyWidth - tipwidth;
|
||||||
|
|
Loading…
Reference in a new issue