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

Function getPositionInsideScheduler

codebase/sources/dhtmlxscheduler.js:15531–15546  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

15529 scheduler2._qi_button_click(node.parentNode);
15530 };
15531 function getPositionInsideScheduler(element) {
15532 let left = 0;
15533 let top = 0;
15534 let node = element;
15535 while (node && node != scheduler2._obj) {
15536 left += node.offsetLeft;
15537 top += node.offsetTop - node.scrollTop;
15538 node = node.offsetParent;
15539 }
15540 if (node) {
15541 let dx = left + element.offsetWidth / 2 > scheduler2._x / 2 ? 1 : 0;
15542 let dy = top + element.offsetHeight / 2 > scheduler2._y / 2 ? 1 : 0;
15543 return { left, top, dx, dy, width: element.offsetWidth, height: element.offsetHeight };
15544 }
15545 return 0;
15546 }
15547 scheduler2._get_event_counter_part = function(id) {
15548 var domEv = scheduler2.getRenderedEvent(id);
15549 return getPositionInsideScheduler(domEv);

Callers 1

quick_infoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected