Make notebook cells selectable for tab navigation. (#8946)

This commit is contained in:
Cory Rivera
2020-01-23 15:39:27 -08:00
committed by GitHub
parent 5ccc0fd97b
commit 2eebcab74a
4 changed files with 22 additions and 2 deletions

View File

@@ -54,6 +54,10 @@ export class CellModel implements ICellModel {
private _isCollapsed: boolean;
private _onCollapseStateChanged = new Emitter<boolean>();
private _modelContentChangedEvent: IModelContentChangedEvent;
private readonly _ariaLabel: string;
private readonly codeCellLabel = localize('codeCellLabel', "Code Cell");
private readonly textCellLabel = localize('textCellLabel', "Text Cell");
constructor(cellData: nb.ICellContents,
private _options: ICellModelOptions,
@@ -67,6 +71,13 @@ export class CellModel implements ICellModel {
this._cellType = CellTypes.Code;
this._source = '';
}
if (this._cellType === CellTypes.Code) {
this._ariaLabel = this.codeCellLabel;
} else {
this._ariaLabel = this.textCellLabel;
}
this._isEditMode = this._cellType !== CellTypes.Markdown;
this._stdInVisible = false;
if (_options && _options.isTrusted) {
@@ -83,6 +94,10 @@ export class CellModel implements ICellModel {
return other !== undefined && other.id === this.id;
}
public get ariaLabel(): string {
return this._ariaLabel;
}
public get onCollapseStateChanged(): Event<boolean> {
return this._onCollapseStateChanged.event;
}

View File

@@ -543,6 +543,7 @@ export interface ICellModel {
readonly onCollapseStateChanged: Event<boolean>;
modelContentChangedEvent: IModelContentChangedEvent;
isEditMode: boolean;
readonly ariaLabel: string;
}
export interface FutureInternal extends nb.IFuture {