Improve window.withProgress in status bar to use a static spin icon (fix #108657)

This commit is contained in:
Benjamin Pasero
2020-10-19 08:04:47 +02:00
parent 74ef0a92fe
commit 8d7ad831e5
7 changed files with 100 additions and 24 deletions

View File

@@ -998,8 +998,15 @@ export function prepend<T extends Node>(parent: HTMLElement, child: T): T {
/**
* Removes all children from `parent` and appends `children`
*/
export function reset(parent: HTMLElement, ...children: Array<Node | string>) {
export function reset(parent: HTMLElement, ...children: Array<Node | string>): void {
parent.innerText = '';
appendChildren(parent, ...children);
}
/**
* Appends `children` to `parent`
*/
export function appendChildren(parent: HTMLElement, ...children: Array<Node | string>): void {
for (const child of children) {
if (child instanceof Node) {
parent.appendChild(child);