Maddy/edit mode events cleanup (#17636)

* remove multiple events

* correct preview check

* add test
This commit is contained in:
Maddy
2021-11-10 10:59:29 -08:00
committed by GitHub
parent b6047ad87d
commit 1d3debb897
6 changed files with 52 additions and 33 deletions

View File

@@ -73,8 +73,6 @@ export class CellModel extends Disposable implements ICellModel {
private _isCollapsed: boolean;
private _onCollapseStateChanged = new Emitter<boolean>();
private _modelContentChangedEvent: IModelContentChangedEvent;
private _onCellPreviewChanged = new Emitter<boolean>();
private _onCellMarkdownChanged = new Emitter<boolean>();
private _isCommandExecutionSettingEnabled: boolean = false;
private _showPreview: boolean = true;
private _showMarkdown: boolean = false;
@@ -422,7 +420,6 @@ export class CellModel extends Disposable implements ICellModel {
public set showPreview(val: boolean) {
this._showPreview = val;
this._onCellPreviewChanged.fire(this._showPreview);
this.doModeUpdates();
}
@@ -432,7 +429,6 @@ export class CellModel extends Disposable implements ICellModel {
public set showMarkdown(val: boolean) {
this._showMarkdown = val;
this._onCellMarkdownChanged.fire(this._showMarkdown);
this.doModeUpdates();
}
@@ -454,14 +450,6 @@ export class CellModel extends Disposable implements ICellModel {
this._cellSourceChanged = val;
}
public get onCellPreviewModeChanged(): Event<boolean> {
return this._onCellPreviewChanged.event;
}
public get onCellMarkdownModeChanged(): Event<boolean> {
return this._onCellMarkdownChanged.event;
}
public get onParameterStateChanged(): Event<boolean> {
return this._onParameterStateChanged.event;
}

View File

@@ -534,8 +534,6 @@ export interface ICellModel {
showPreview: boolean;
showMarkdown: boolean;
defaultTextEditMode: string;
readonly onCellPreviewModeChanged: Event<boolean>;
readonly onCellMarkdownModeChanged: Event<boolean>;
sendChangeToNotebook(change: NotebookChangeType): void;
cellSourceChanged: boolean;
readonly savedConnectionName: string | undefined;