MCPcopy Index your code
hub / github.com/hoothin/UserScripts / syncSaveBtnLayout

Function syncSaveBtnLayout

Pagetual/pagetual.user.js:10373–10383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10371 configCon.appendChild(saveBtn);
10372 saveBtn.style.display = "none";
10373 const syncSaveBtnLayout = () => {
10374 if (!configCon || !saveBtn) return;
10375 const rect = configCon.getBoundingClientRect();
10376 if (rect.width > 0) {
10377 document.documentElement.style.setProperty("--config-left", `${rect.left}px`);
10378 document.documentElement.style.setProperty("--config-width", `${rect.width}px`);
10379 saveBtn.style.display = "";
10380 } else {
10381 saveBtn.style.display = "none";
10382 }
10383 };
10384 syncSaveBtnLayout();
10385 window.addEventListener("resize", syncSaveBtnLayout);
10386 if (window.ResizeObserver) {

Callers 1

initConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected