mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 15:25:01 -04:00
[#181] move setVisibility to App.mjs since it's pretty generic and could be reused. Update TODO
This commit is contained in:
parent
f6b23ecca5
commit
12116e53b1
3 changed files with 29 additions and 34 deletions
|
@ -860,6 +860,25 @@ class App {
|
|||
this.loadURIParams();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set element visibility
|
||||
*
|
||||
* @param {HTMLElement} elm
|
||||
* @param {boolean} isVisible
|
||||
*
|
||||
*/
|
||||
setVisibility( elm, isVisible ){
|
||||
if ( isVisible ) {
|
||||
if ( elm.classList.contains("hidden")) {
|
||||
elm.classList.remove("hidden");
|
||||
}
|
||||
} else if ( isVisible === false ) {
|
||||
if ( !elm.classList.contains("hidden")){
|
||||
elm.classList.add("hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue