auto-sync: 2026-05-13 16:30:01

This commit is contained in:
Stream
2026-05-13 16:30:03 +03:00
parent 03840d3400
commit 7a7ca34609
6 changed files with 173 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import sys
path = "/home/slin/enduro-trails/prototype/static/app.js"
with open(path, 'r') as f:
content = f.read()
# Replace the positioning logic
old = """const rect = btn.getBoundingClientRect();
popup.style.top = rect.top + 'px';
popup.style.right = (window.innerWidth - rect.left + 8) + 'px';"""
new = """const rect = btn.getBoundingClientRect();
popup.style.right = (window.innerWidth - rect.left + 8) + 'px';
// Position: align bottom of popup with bottom of button, ensure fits in viewport
const popupHeight = popup.offsetHeight;
const desiredTop = rect.bottom - popupHeight;
const minTop = 8;
popup.style.top = Math.max(minTop, desiredTop) + 'px';"""
if old not in content:
print("ERROR: old text not found")
sys.exit(1)
content = content.replace(old, new)
with open(path, 'w') as f:
f.write(content)
print("OK - positioning fixed")