MCPcopy Index your code
hub / github.com/shipshapecode/tether / position

Function position

src/js/shift.js:4–31  ·  view source on GitHub ↗
({ top, left })

Source from the content-addressed store, hash-verified

2
3export default {
4 position({ top, left }) {
5 if (!this.options.shift) {
6 return;
7 }
8
9 let { shift } = this.options;
10 if (isFunction(shift)) {
11 shift = shift.call(this, { top, left });
12 }
13
14 let shiftTop, shiftLeft;
15 if (isString(shift)) {
16 shift = shift.split(' ');
17 shift[1] = shift[1] || shift[0];
18
19 ([shiftTop, shiftLeft] = shift);
20
21 shiftTop = parseFloat(shiftTop, 10);
22 shiftLeft = parseFloat(shiftLeft, 10);
23 } else {
24 ([shiftTop, shiftLeft] = [shift.top, shift.left]);
25 }
26
27 top += shiftTop;
28 left += shiftLeft;
29
30 return { top, left };
31 }
32};

Callers

nothing calls this directly

Calls 2

isFunctionFunction · 0.90
isStringFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…