#include msgbox.jsx #include comments/api.js const MszCommentsOptionsLockAction = function(catInfo, reinit) { const element = ; element.onclick = async () => { element.disabled = true; try { await section.reload(); } catch(ex) { console.error(ex); } finally { element.disabled = false; } }; return { get element() { return element; }, }; }; const MszCommentsOptions = function() { const actions =
; const element = ; const hideIfNoChildren = () => { element.classList.toggle('hidden', actions.childElementCount < 1); }; hideIfNoChildren(); return { get element() { return element; }, reset() { $removeChildren(actions); hideIfNoChildren(); }, appendAction(action) { actions.appendChild(action.element); hideIfNoChildren(); }, }; };