Files
discord-decomp/_bundle/Module1692.js
T
2026-11-01 12:12:55 +02:00

39 lines
1.2 KiB
JavaScript

// Metro module 1692 (f1693).
import { _updatePropsJS } from "./setNativeProps";
export const snapshots = new WeakMap();
export function makeElementVisible(a0, a1) {
if (a1 === 0) {
_updatePropsJS({
visibility: "initial"
}, a0);
} else {
setTimeout(() => {
_updatePropsJS({
visibility: "initial"
}, a0);
}, 1000 * a1);
}
}
export function setElementPosition(a0, a1) {
a0.style.transform = "";
a0.style.position = "absolute";
a0.style.top = `${a1.top}px`;
a0.style.left = `${a1.left}px`;
a0.style.width = `${a1.width}px`;
a0.style.height = `${a1.height}px`;
a0.style.margin = "0px";
if (a0.parentElement) {
const parentElement = a0.parentElement;
const boundingClientRect = parentElement.getBoundingClientRect();
const r9 = parseInt(getComputedStyle(parentElement).borderTopWidth);
const r45 = parseInt(getComputedStyle(parentElement).borderLeftWidth);
const boundingClientRect2 = a0.getBoundingClientRect();
if (boundingClientRect2.top !== a1.top) {
a0.style.top = a1.top - boundingClientRect.top - r9 + "px";
}
if (boundingClientRect2.left !== a1.left) {
a0.style.left = a1.left - boundingClientRect.left - r45 + "px";
}
}
}