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

Function autoToFixedAttachment

src/js/utils/offset.js:56–68  ·  view source on GitHub ↗
(attachment, relativeToAttachment)

Source from the content-addressed store, hash-verified

54}
55
56export function autoToFixedAttachment(attachment, relativeToAttachment) {
57 let { left, top } = attachment;
58
59 if (left === 'auto') {
60 left = MIRROR_LR[relativeToAttachment.left];
61 }
62
63 if (top === 'auto') {
64 top = MIRROR_TB[relativeToAttachment.top];
65 }
66
67 return { left, top };
68}
69
70export function offsetToPx(offset, size) {
71 if (isString(offset.left) && offset.left.indexOf('%') !== -1) {

Callers 2

offset.spec.jsFile · 0.90
positionMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…