({ top, left })
| 2 | |
| 3 | export 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 | }; |
nothing calls this directly
no test coverage detected
searching dependent graphs…