Skip to content

Commit

Permalink
fixes wobbly progress indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
sbatten committed Apr 25, 2019
1 parent 6cc34bb commit 0fde661
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 40 deletions.
19 changes: 0 additions & 19 deletions src/vs/base/browser/ui/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class Dialog extends Disposable {
private buttonGroup: ButtonGroup | undefined;
private styles: IDialogStyles | undefined;
private focusToReturn: HTMLElement | undefined;
private iconRotatingInternal: number | undefined;

constructor(private container: HTMLElement, private message: string, private buttons: string[], private options: IDialogOptions) {
super();
Expand Down Expand Up @@ -163,15 +162,6 @@ export class Dialog extends Disposable {
break;
case 'pending':
addClass(this.iconElement, 'icon-pending');
let deg = 0;
this.iconRotatingInternal = window.setInterval(() => {
if (this.iconElement) {
this.iconElement.style.transform = `rotate(${deg}deg)`;
deg += 45; // 360 / 8
} else {
this.stopAnimation();
}
}, 125 /** 1000 / 8 */);
break;
case 'none':
case 'info':
Expand Down Expand Up @@ -199,13 +189,6 @@ export class Dialog extends Disposable {
});
}

private stopAnimation() {
if (this.iconRotatingInternal) {
window.clearInterval(this.iconRotatingInternal);
this.iconRotatingInternal = undefined;
}
}

private applyStyles() {
if (this.styles) {
const style = this.styles;
Expand Down Expand Up @@ -240,8 +223,6 @@ export class Dialog extends Disposable {
this.modal = undefined;
}

this.stopAnimation();

if (this.focusToReturn && isAncestor(this.focusToReturn, document.body)) {
this.focusToReturn.focus();
this.focusToReturn = undefined;
Expand Down
32 changes: 25 additions & 7 deletions src/vs/base/browser/ui/dialog/pending-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 25 additions & 7 deletions src/vs/base/browser/ui/dialog/pending-hc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 25 additions & 7 deletions src/vs/base/browser/ui/dialog/pending.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0fde661

Please # to comment.