mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
Add dom.toggleVisibility helper (#175960)
Adds a helper function for toggling if a set of elements are visible or hidden
This commit is contained in:
@@ -1040,6 +1040,14 @@ export function join(nodes: Node[], separator: Node | string): Node[] {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function setVisibility(visible: boolean, ...elements: HTMLElement[]): void {
|
||||
if (visible) {
|
||||
show(...elements);
|
||||
} else {
|
||||
hide(...elements);
|
||||
}
|
||||
}
|
||||
|
||||
export function show(...elements: HTMLElement[]): void {
|
||||
for (const element of elements) {
|
||||
element.style.display = '';
|
||||
|
||||
Reference in New Issue
Block a user