From 944a77fe42c715db5c2fe37de21d1708d4dab0b0 Mon Sep 17 00:00:00 2001 From: Yurong He <43652751+YurongHe@users.noreply.github.com> Date: Fri, 7 Dec 2018 13:07:00 -0800 Subject: [PATCH] Fixed #3287 adding loading-spinner to markdown cell (#3505) --- .../notebook/cellViews/textCell.component.html | 1 + .../notebook/cellViews/textCell.component.ts | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/sql/parts/notebook/cellViews/textCell.component.html b/src/sql/parts/notebook/cellViews/textCell.component.html index 05b735c123..fa6da935eb 100644 --- a/src/sql/parts/notebook/cellViews/textCell.component.html +++ b/src/sql/parts/notebook/cellViews/textCell.component.html @@ -5,6 +5,7 @@ *--------------------------------------------------------------------------------------------*/ -->
+
diff --git a/src/sql/parts/notebook/cellViews/textCell.component.ts b/src/sql/parts/notebook/cellViews/textCell.component.ts index 6bb57c3468..79caeda2c1 100644 --- a/src/sql/parts/notebook/cellViews/textCell.component.ts +++ b/src/sql/parts/notebook/cellViews/textCell.component.ts @@ -16,6 +16,9 @@ import { ICellModel } from 'sql/parts/notebook/models/modelInterfaces'; import { ISanitizer, defaultSanitizer } from 'sql/parts/notebook/outputs/sanitizer'; import { localize } from 'vs/nls'; import { NotebookModel } from 'sql/parts/notebook/models/notebookModel'; +import { Emitter } from 'vs/base/common/event'; +import URI from 'vs/base/common/uri'; +import { IOpenerService } from 'vs/platform/opener/common/opener'; export const TEXT_SELECTOR: string = 'text-cell-component'; @@ -40,15 +43,20 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { private _sanitizer: ISanitizer; private _model: NotebookModel; private _activeCellId: string; + private readonly _onDidClickLink = this._register(new Emitter()); + public readonly onDidClickLink = this._onDidClickLink.event; + protected isLoading: boolean; constructor( @Inject(forwardRef(() => CommonServiceInterface)) private _bootstrapService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, - @Inject(ICommandService) private _commandService: ICommandService + @Inject(ICommandService) private _commandService: ICommandService, + @Inject(IOpenerService) private readonly openerService: IOpenerService, ) { super(); this.isEditMode = false; + this.isLoading = true; } //Gets sanitizer from ISanitizer interface @@ -67,8 +75,14 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { return this._activeCellId; } + private setLoading(isLoading: boolean): void { + this.isLoading = isLoading; + this._changeRef.detectChanges(); + } + ngOnInit() { this.updatePreview(); + this.setLoading(false); this._register(this.themeService.onDidColorThemeChange(this.updateTheme, this)); this.updateTheme(this.themeService.getColorTheme()); this.cellModel.onOutputsChanged(e => {