(function () { if (!/^\/resource-type\//.test(location.pathname)) return; var list = document.querySelector('[fs-list-instance="main"][fs-list-element="list"]'); var select = document.querySelector('select[fs-list-element="select"][fs-list-field="category"]'); if (!list || !list.children.length) return; var wrap = list.parentElement; wrap.style.minHeight = wrap.offsetHeight + 'px'; var done = false, timer = null; function release() { if (done) return; done = true; clearTimeout(timer); mo.disconnect(); wrap.style.minHeight = ''; } function settle() { // release only while the list is showing items again; otherwise look again shortly if (list.children.length && list.offsetParent) release(); else timer = setTimeout(settle, 200); } // Release once the list has been re-rendered after the sector filter is set and shows items again. var mo = new MutationObserver(function () { if (select && !select.value) return; clearTimeout(timer); timer = setTimeout(settle, 300); }); mo.observe(list, { childList: true }); setTimeout(release, 20000); })();