diff --git a/assets/js/staffhider.js b/assets/js/staffhider.js deleted file mode 100644 index 68b64447..00000000 --- a/assets/js/staffhider.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * StaffHider - * - * Hide staff elements if enabled in the settings. - */ - -import { $$ } from './utils/dom'; - -function hideStaffTools() { - if (window.booru.hideStaffTools === 'true') { - $$('.js-staff-action').forEach(el => { - el.classList.add('hidden'); - }); - } -} - -export { hideStaffTools }; diff --git a/assets/js/staffhider.ts b/assets/js/staffhider.ts new file mode 100644 index 00000000..86741d78 --- /dev/null +++ b/assets/js/staffhider.ts @@ -0,0 +1,13 @@ +/** + * StaffHider + * + * Hide staff elements if enabled in the settings. + */ + +import { $$, hideEl } from './utils/dom'; + +export function hideStaffTools() { + if (window.booru.hideStaffTools === 'true') { + $$('.js-staff-action').forEach(el => hideEl(el)); + } +} diff --git a/assets/types/booru-object.d.ts b/assets/types/booru-object.d.ts index 22d1aa08..2a5949c0 100644 --- a/assets/types/booru-object.d.ts +++ b/assets/types/booru-object.d.ts @@ -65,6 +65,10 @@ interface BooruObject { spoileredFilter: AstMatcher; tagsVersion: number; interactions: Interaction[]; + /** + * Indicates whether sensitive staff-only info should be hidden or not. + */ + hideStaffTools: string; } declare global {