Add buttons to Notebooks for creating new cells between other existing cells (#6596)

This commit is contained in:
Cory Rivera
2019-08-06 10:31:46 -07:00
committed by GitHub
parent a0163c8625
commit 308029c03c
9 changed files with 174 additions and 44 deletions

View File

@@ -159,6 +159,14 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
return this._model ? this._model.cells : [];
}
public get addCodeLabel(): string {
return localize('addCodeLabel', "Add code");
}
public get addTextLabel(): string {
return localize('addTextLabel', "Add text");
}
private updateTheme(theme: IColorTheme): void {
let toolbarEl = <HTMLElement>this.toolbar.nativeElement;
toolbarEl.style.borderBottomColor = theme.getColor(themeColors.SIDE_BAR_BACKGROUND, true).toString();
@@ -192,8 +200,8 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
}
// Add cell based on cell type
public addCell(cellType: CellType) {
this._model.addCell(cellType);
public addCell(cellType: CellType, index?: number) {
this._model.addCell(cellType, index);
}
public onKeyDown(event) {