MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / _calculateTooltipPosition

Method _calculateTooltipPosition

codebase/dhtmlxscheduler.es.js:6585–6590  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

6583 return this._root || document.body;
6584 }
6585 _calculateTooltipPosition(i) {
6586 const t = this._scheduler, n = t.$domHelpers, s = this._getViewPortSize(), a = this.getNode(), o = { top: 0, left: 0, width: a.offsetWidth, height: a.offsetHeight, bottom: 0, right: 0 }, _ = t.config.tooltip_offset_x, r = t.config.tooltip_offset_y, d = document.body, l = n.getRelativeEventPosition(i, d), h = n.getNodePosition(d);
6587 l.y += h.y, o.top = l.y, o.left = l.x, o.top += r, o.left += _, o.bottom = o.top + o.height, o.right = o.left + o.width;
6588 const p = window.scrollY + d.scrollTop;
6589 return o.top < s.top - p ? (o.top = s.top, o.bottom = o.top + o.height) : o.bottom > s.bottom && (o.bottom = s.bottom, o.top = o.bottom - o.height), o.left < s.left ? (o.left = s.left, o.right = s.left + o.width) : o.right > s.right && (o.right = s.right, o.left = o.right - o.width), l.x >= o.left && l.x <= o.right && (o.left = l.x - o.width - _, o.right = o.left + o.width), l.y >= o.top && l.y <= o.bottom && (o.top = l.y - o.height - r, o.bottom = o.top + o.height), o.left < 0 && (o.left = 0), o.right < 0 && (o.right = 0), o;
6590 }
6591 _getViewPortSize() {
6592 const i = this._scheduler, t = i.$domHelpers, n = this._getViewPort();
6593 let s, a = n, o = window.scrollY + document.body.scrollTop, _ = window.scrollX + document.body.scrollLeft;

Callers 1

showMethod · 0.95

Calls 2

_getViewPortSizeMethod · 0.95
getNodeMethod · 0.95

Tested by

no test coverage detected