Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function mountOverlay(overlay) {
let w;
let h;
let clicked;
const slider = mount(overlay.parentNode, ['div', { class: 'slider' }], tag);
function sync() {
w = overlay.parentNode.offsetWidth;
h = overlay.parentNode.offsetHeight;
overlay.style.width = `${w / 2}px`;
slider.style.left = `${(w / 2) - (slider.offsetWidth / 2)}px`;
slider.style.top = `${(h / 2) - (slider.offsetHeight / 2)}px`;
}
function slide(x) {
overlay.style.width = `${x}px`;
slider.style.left = `${overlay.offsetWidth - (slider.offsetWidth / 2)}px`;
}
['button.noop', { onclick: () => openModal(key, true, images) }, 'Open diff'],
['button.noop', { onclick: () => openModal(key, false, images) }, 'Compare'],
]],
]],
]];
}
function ImageList() {
if (!images.length) {
return ['ul', [['li', 'No differences to report']]];
}
return ['ul', images.map((x, key) => ImageItem(x, key))];
}
mount([ImageList], tag);