Refactor the custom helpers into their own files
This commit is contained in:
parent
af2df4f7c5
commit
0392d339db
7 changed files with 69 additions and 62 deletions
11
module/helpers/detailsExpanded.mjs
Normal file
11
module/helpers/detailsExpanded.mjs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Checks if the specified collapseId is currently open, so that during re-renders
|
||||
* it remains open or closed.
|
||||
*
|
||||
* @param {Set<string>} expanded A set indicating what collapseIds are expanded
|
||||
* @param {string} collapseId The collapseId to check for
|
||||
* @returns {"open"|null} The HTML insertion indicating the details is expanded
|
||||
*/
|
||||
export function detailsExpanded(expanded, collapseId) {
|
||||
return expanded.has(collapseId) ? "open" : null;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue