mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 17:22:59 -05:00
3240: Empty cells show thick border (#3242)
* 3240: Empty cells show thick border * 3240: Refactoring code and markdown css selection +output UI improvement
This commit is contained in:
@@ -31,6 +31,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
private _content: string;
|
||||
private isEditMode: boolean;
|
||||
private _sanitizer: ISanitizer;
|
||||
private _previewCssApplied: boolean = false;
|
||||
private _activeCellId: string;
|
||||
|
||||
constructor(
|
||||
@@ -113,12 +114,29 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
public handleContentChanged(): void {
|
||||
if (!this._previewCssApplied) {
|
||||
this.updatePreviewCssClass();
|
||||
}
|
||||
this.updatePreview();
|
||||
}
|
||||
|
||||
public toggleEditMode(): void {
|
||||
this.isEditMode = !this.isEditMode;
|
||||
this.updatePreviewCssClass();
|
||||
this.updatePreview();
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
|
||||
// Updates the css class to preview 'div' based on edit mode
|
||||
private updatePreviewCssClass() {
|
||||
let outputElement = <HTMLElement>this.output.nativeElement;
|
||||
if (this.isEditMode && this.cellModel.source) {
|
||||
outputElement.className = 'notebook-preview';
|
||||
this._previewCssApplied = true;
|
||||
}
|
||||
else {
|
||||
outputElement.className = '';
|
||||
this._previewCssApplied = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user