tackle comments
This commit is contained in:
parent
5a167bb2fd
commit
084b8148b7
2 changed files with 10 additions and 7 deletions
|
@ -43,18 +43,18 @@ export const DEFAULT_EDITOR_PART_OPTIONS: IEditorPartOptions = {
|
|||
};
|
||||
|
||||
export function computeEditorAriaLabel(input: IEditorInput, group: IEditorGroup | undefined, groupCount: number): string {
|
||||
let ariaLabel = input.ariaLabel;
|
||||
let ariaLabel = input.getAriaLabel();
|
||||
if (group && !group.isPinned(input)) {
|
||||
ariaLabel += localize('preview', ", preview");
|
||||
ariaLabel = `${ariaLabel}, ${localize('preview', "preview")}`;
|
||||
}
|
||||
if (group && group.isSticky(input)) {
|
||||
ariaLabel += localize('pinned', ", pinned");
|
||||
ariaLabel = `${ariaLabel}, ${localize('pinned', "pinned")}`;
|
||||
}
|
||||
// Apply group information to help identify in
|
||||
// which group we are (only if more than one group
|
||||
// is actually opened)
|
||||
if (group && groupCount > 1) {
|
||||
ariaLabel += ', ' + group.ariaLabel;
|
||||
ariaLabel = `${ariaLabel}, ${group.ariaLabel}`;
|
||||
}
|
||||
|
||||
return ariaLabel;
|
||||
|
|
|
@ -383,8 +383,6 @@ export interface IEditorInput extends IDisposable {
|
|||
*/
|
||||
readonly resource: URI | undefined;
|
||||
|
||||
ariaLabel: string;
|
||||
|
||||
/**
|
||||
* Unique type identifier for this inpput.
|
||||
*/
|
||||
|
@ -405,6 +403,11 @@ export interface IEditorInput extends IDisposable {
|
|||
*/
|
||||
getTitle(verbosity?: Verbosity): string | undefined;
|
||||
|
||||
/**
|
||||
* Returns the aria label to be read out by a screen reader.
|
||||
*/
|
||||
getAriaLabel(): string;
|
||||
|
||||
/**
|
||||
* Resolves the input.
|
||||
*/
|
||||
|
@ -514,7 +517,7 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
|
|||
return this.getName();
|
||||
}
|
||||
|
||||
get ariaLabel(): string {
|
||||
getAriaLabel(): string {
|
||||
return this.getTitle(Verbosity.SHORT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue