mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
Merge pull request #278 from philomena-dev/ts-staffhider
Convert staffhider to TypeScript
This commit is contained in:
commit
2dfacd6eac
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