Fix decorator error
This commit is contained in:
@@ -11,7 +11,7 @@ import { RenderDebouncer } from 'browser/RenderDebouncer';
|
|||||||
import { addDisposableDomListener } from 'browser/Lifecycle';
|
import { addDisposableDomListener } from 'browser/Lifecycle';
|
||||||
import { Disposable } from 'common/Lifecycle';
|
import { Disposable } from 'common/Lifecycle';
|
||||||
import { ScreenDprMonitor } from 'browser/ScreenDprMonitor';
|
import { ScreenDprMonitor } from 'browser/ScreenDprMonitor';
|
||||||
import { IRenderDimensions } from 'browser/renderer/Types';
|
import { IRenderService } from 'browser/services/Services';
|
||||||
|
|
||||||
const MAX_ROWS_TO_READ = 20;
|
const MAX_ROWS_TO_READ = 20;
|
||||||
|
|
||||||
@@ -47,8 +47,8 @@ export class AccessibilityManager extends Disposable {
|
|||||||
private _charsToAnnounce: string = '';
|
private _charsToAnnounce: string = '';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _terminal: ITerminal,
|
private readonly _terminal: ITerminal,
|
||||||
private _dimensions: IRenderDimensions
|
private readonly _renderService: IRenderService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this._accessibilityTreeRoot = document.createElement('div');
|
this._accessibilityTreeRoot = document.createElement('div');
|
||||||
@@ -90,6 +90,7 @@ export class AccessibilityManager extends Disposable {
|
|||||||
this.register(this._terminal.onA11yTab(spaceCount => this._onTab(spaceCount)));
|
this.register(this._terminal.onA11yTab(spaceCount => this._onTab(spaceCount)));
|
||||||
this.register(this._terminal.onKey(e => this._onKey(e.key)));
|
this.register(this._terminal.onKey(e => this._onKey(e.key)));
|
||||||
this.register(this._terminal.onBlur(() => this._clearLiveRegion()));
|
this.register(this._terminal.onBlur(() => this._clearLiveRegion()));
|
||||||
|
this.register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions()));
|
||||||
|
|
||||||
this._screenDprMonitor = new ScreenDprMonitor();
|
this._screenDprMonitor = new ScreenDprMonitor();
|
||||||
this.register(this._screenDprMonitor);
|
this.register(this._screenDprMonitor);
|
||||||
@@ -271,7 +272,7 @@ export class AccessibilityManager extends Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _refreshRowsDimensions(): void {
|
private _refreshRowsDimensions(): void {
|
||||||
if (!this._dimensions.actualCellHeight) {
|
if (!this._renderService.dimensions.actualCellHeight) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this._rowElements.length !== this._terminal.rows) {
|
if (this._rowElements.length !== this._terminal.rows) {
|
||||||
@@ -282,13 +283,8 @@ export class AccessibilityManager extends Disposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public setDimensions(dimensions: IRenderDimensions): void {
|
|
||||||
this._dimensions = dimensions;
|
|
||||||
this._refreshRowsDimensions();
|
|
||||||
}
|
|
||||||
|
|
||||||
private _refreshRowDimensions(element: HTMLElement): void {
|
private _refreshRowDimensions(element: HTMLElement): void {
|
||||||
element.style.height = `${this._dimensions.actualCellHeight}px`;
|
element.style.height = `${this._renderService.dimensions.actualCellHeight}px`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _announceCharacters(): void {
|
private _announceCharacters(): void {
|
||||||
|
|||||||
+3
-4
@@ -30,7 +30,7 @@ import { C0 } from 'common/data/EscapeSequences';
|
|||||||
import { InputHandler } from './InputHandler';
|
import { InputHandler } from './InputHandler';
|
||||||
import { Renderer } from './renderer/Renderer';
|
import { Renderer } from './renderer/Renderer';
|
||||||
import { Linkifier } from 'browser/Linkifier';
|
import { Linkifier } from 'browser/Linkifier';
|
||||||
import { SelectionService } from './browser/services/SelectionService';
|
import { SelectionService } from 'browser/services/SelectionService';
|
||||||
import * as Browser from 'common/Platform';
|
import * as Browser from 'common/Platform';
|
||||||
import { addDisposableDomListener } from 'browser/Lifecycle';
|
import { addDisposableDomListener } from 'browser/Lifecycle';
|
||||||
import * as Strings from 'browser/LocalizableStrings';
|
import * as Strings from 'browser/LocalizableStrings';
|
||||||
@@ -394,7 +394,7 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
case 'screenReaderMode':
|
case 'screenReaderMode':
|
||||||
if (this.optionsService.options.screenReaderMode) {
|
if (this.optionsService.options.screenReaderMode) {
|
||||||
if (!this._accessibilityManager && this._renderService) {
|
if (!this._accessibilityManager && this._renderService) {
|
||||||
this._accessibilityManager = new AccessibilityManager(this, this._renderService.dimensions);
|
this._accessibilityManager = new AccessibilityManager(this, this._renderService);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this._accessibilityManager) {
|
if (this._accessibilityManager) {
|
||||||
@@ -665,8 +665,7 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
if (this.options.screenReaderMode) {
|
if (this.options.screenReaderMode) {
|
||||||
// Note that this must be done *after* the renderer is created in order to
|
// Note that this must be done *after* the renderer is created in order to
|
||||||
// ensure the correct order of the dprchange event
|
// ensure the correct order of the dprchange event
|
||||||
this._accessibilityManager = new AccessibilityManager(this, this._renderService.dimensions);
|
this._accessibilityManager = new AccessibilityManager(this, this._renderService);
|
||||||
this._accessibilityManager.register(this._renderService.onDimensionsChange(e => this._accessibilityManager.setDimensions(e)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Measure the character size
|
// Measure the character size
|
||||||
|
|||||||
Reference in New Issue
Block a user