mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Make "Double-click to edit" in empty md cell a bit nicer looking (#4102)
This commit is contained in:
committed by
Kevin Cunnane
parent
889d5e5b28
commit
1e915aad20
@@ -129,9 +129,10 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
|||||||
private updatePreview() {
|
private updatePreview() {
|
||||||
if (this._content !== this.cellModel.source || this.cellModel.source.length === 0) {
|
if (this._content !== this.cellModel.source || this.cellModel.source.length === 0) {
|
||||||
if (!this.cellModel.source && !this.isEditMode) {
|
if (!this.cellModel.source && !this.isEditMode) {
|
||||||
(<HTMLElement>this.output.nativeElement).innerHTML = localize('doubleClickEdit', 'Double-click to edit');
|
this._content = localize('doubleClickEdit', 'Double-click to edit');
|
||||||
} else {
|
} else {
|
||||||
this._content = this.sanitizeContent(this.cellModel.source);
|
this._content = this.sanitizeContent(this.cellModel.source);
|
||||||
|
}
|
||||||
// todo: pass in the notebook filename instead of undefined value
|
// todo: pass in the notebook filename instead of undefined value
|
||||||
this._commandService.executeCommand<string>('notebook.showPreview', undefined, this._content).then((htmlcontent) => {
|
this._commandService.executeCommand<string>('notebook.showPreview', undefined, this._content).then((htmlcontent) => {
|
||||||
let outputElement = <HTMLElement>this.output.nativeElement;
|
let outputElement = <HTMLElement>this.output.nativeElement;
|
||||||
@@ -139,7 +140,6 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//Sanitizes the content based on trusted mode of Cell Model
|
//Sanitizes the content based on trusted mode of Cell Model
|
||||||
private sanitizeContent(content: string): string {
|
private sanitizeContent(content: string): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user