/* uporabne zadeve za vmesnik */ function getScrollParent(node) { if (node == null) { return null; } if (node.scrollHeight > node.clientHeight) { return node; } else { return getScrollParent(node.parentNode); } } export const useUi = () => ({ poskrolaj: (sekcija, timeout = 50) => { setTimeout(() => { if (sekcija) { const top = sekcija.getBoundingClientRect().top getScrollParent(sekcija).scrollTo({ top, behavior: 'smooth' }) } }, timeout) } })