mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
Convert staffhider to TypeScript
This commit is contained in:
parent
d8fd98ea27
commit
43fd14f0a8
3 changed files with 17 additions and 17 deletions
|
@ -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 };
|
13
assets/js/staffhider.ts
Normal file
13
assets/js/staffhider.ts
Normal file
|
@ -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') {
|
||||
$$<HTMLElement>('.js-staff-action').forEach(el => hideEl(el));
|
||||
}
|
||||
}
|
4
assets/types/booru-object.d.ts
vendored
4
assets/types/booru-object.d.ts
vendored
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue