Added code to enable disable split cell icon (#17331)

* Added code to enable diable split cell icon

* adding back the deleted code

* refactored

* minimized lines

* simplified code

* minor change

* minor change

* Addressed PR

* Addressed PR

* removing unused enum value
This commit is contained in:
rajeshka
2021-10-11 09:47:25 -07:00
committed by GitHub
parent af58a52004
commit f5331e3d69
4 changed files with 16 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ export class CellModel extends Disposable implements ICellModel {
private _onTableUpdated = new Emitter<ITableUpdatedEvent>();
private _onCellModeChanged = new Emitter<boolean>();
private _onExecutionStateChanged = new Emitter<CellExecutionState>();
private _onCurrentEditModeChanged = new Emitter<CellEditModes>();
private _isTrusted: boolean;
private _active: boolean;
private _hover: boolean;
@@ -382,6 +383,10 @@ export class CellModel extends Disposable implements ICellModel {
return this._onExecutionStateChanged.event;
}
public get onCurrentEditModeChanged(): Event<CellEditModes> {
return this._onCurrentEditModeChanged.event;
}
private fireExecutionStateChanged(): void {
this._onExecutionStateChanged.fire(this.executionState);
}
@@ -416,6 +421,7 @@ export class CellModel extends Disposable implements ICellModel {
public set showPreview(val: boolean) {
this._showPreview = val;
this._onCellPreviewChanged.fire(this._showPreview);
this._onCurrentEditModeChanged.fire(this.currentMode);
}
public get showMarkdown(): boolean {
@@ -425,6 +431,7 @@ export class CellModel extends Disposable implements ICellModel {
public set showMarkdown(val: boolean) {
this._showMarkdown = val;
this._onCellMarkdownChanged.fire(this._showMarkdown);
this._onCurrentEditModeChanged.fire(this.currentMode);
}
public get defaultTextEditMode(): string {

View File

@@ -540,6 +540,7 @@ export interface ICellModel {
cellSourceChanged: boolean;
readonly savedConnectionName: string | undefined;
attachments: nb.ICellAttachments | undefined;
readonly onCurrentEditModeChanged: Event<CellEditModes>;
readonly currentMode: CellEditModes;
/**
* Adds image as an attachment to cell metadata