Skip to content

Commit

Permalink
Embarrassing attempt at refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyStk committed Aug 18, 2024
1 parent 29a5da4 commit 201d766
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions integreat_cms/static/src/js/dashboard/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* const showAllTotalNumbers = () => {
const elements = document.querySelectorAll<HTMLElement>(".total-results");
elements.forEach((element) => {
if (!element.closest("#broken-links") && !element.closest("#translation-coverage")) {
const el = element;
el.classList.remove("hidden");
}
});
};
showAllTotalNumbers();
export const hideWaitingMessage = (element: HTMLElement) => {
element.querySelector(".waiting-message").classList.add("hidden");
};
export const showSuccessMessage = (element: HTMLElement) => {
element.querySelector(".success-message").classList.remove("hidden");
};
export const showSuccessIcon = (element: HTMLElement) => {
element.querySelector(".success-icon").classList.remove("hidden");
};
export const showDescription = (element: HTMLElement, affectedPageTitle: string) => {
element.querySelector(".todo-message").classList.remove("hidden");
(element.querySelector(".todo-message b") as HTMLElement).innerText = affectedPageTitle;
};
export const showNumberOfPagesElement = (element: HTMLElement, ) => {
element.querySelector(".total-results").classList.remove("hidden");
};
export const updateNumberOfPages = (element: HTMLElement, numberOfPages: number) => {
(element.querySelector(".total-results span") as HTMLElement).innerText = numberOfPages.toString();
};
*/

0 comments on commit 201d766

Please sign in to comment.