Fix decorator error

This commit is contained in:
Daniel Imms
2019-07-14 00:41:37 -07:00
parent 05992e093b
commit 1df737c394
2 changed files with 9 additions and 14 deletions
+6 -10
View File
@@ -11,7 +11,7 @@ import { RenderDebouncer } from 'browser/RenderDebouncer';
import { addDisposableDomListener } from 'browser/Lifecycle';
import { Disposable } from 'common/Lifecycle';
import { ScreenDprMonitor } from 'browser/ScreenDprMonitor';
import { IRenderDimensions } from 'browser/renderer/Types';
import { IRenderService } from 'browser/services/Services';
const MAX_ROWS_TO_READ = 20;
@@ -47,8 +47,8 @@ export class AccessibilityManager extends Disposable {
private _charsToAnnounce: string = '';
constructor(
private _terminal: ITerminal,
private _dimensions: IRenderDimensions
private readonly _terminal: ITerminal,
private readonly _renderService: IRenderService
) {
super();
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.onKey(e => this._onKey(e.key)));
this.register(this._terminal.onBlur(() => this._clearLiveRegion()));
this.register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions()));
this._screenDprMonitor = new ScreenDprMonitor();
this.register(this._screenDprMonitor);
@@ -271,7 +272,7 @@ export class AccessibilityManager extends Disposable {
}
private _refreshRowsDimensions(): void {
if (!this._dimensions.actualCellHeight) {
if (!this._renderService.dimensions.actualCellHeight) {
return;
}
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 {
element.style.height = `${this._dimensions.actualCellHeight}px`;
element.style.height = `${this._renderService.dimensions.actualCellHeight}px`;
}
private _announceCharacters(): void {
+3 -4
View File
@@ -30,7 +30,7 @@ import { C0 } from 'common/data/EscapeSequences';
import { InputHandler } from './InputHandler';
import { Renderer } from './renderer/Renderer';
import { Linkifier } from 'browser/Linkifier';
import { SelectionService } from './browser/services/SelectionService';
import { SelectionService } from 'browser/services/SelectionService';
import * as Browser from 'common/Platform';
import { addDisposableDomListener } from 'browser/Lifecycle';
import * as Strings from 'browser/LocalizableStrings';
@@ -394,7 +394,7 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
case 'screenReaderMode':
if (this.optionsService.options.screenReaderMode) {
if (!this._accessibilityManager && this._renderService) {
this._accessibilityManager = new AccessibilityManager(this, this._renderService.dimensions);
this._accessibilityManager = new AccessibilityManager(this, this._renderService);
}
} else {
if (this._accessibilityManager) {
@@ -665,8 +665,7 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
if (this.options.screenReaderMode) {
// Note that this must be done *after* the renderer is created in order to
// ensure the correct order of the dprchange event
this._accessibilityManager = new AccessibilityManager(this, this._renderService.dimensions);
this._accessibilityManager.register(this._renderService.onDimensionsChange(e => this._accessibilityManager.setDimensions(e)));
this._accessibilityManager = new AccessibilityManager(this, this._renderService);
}
// Measure the character size