@@ -22,7 +22,14 @@ import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/
22
22
import { IDisposable } from 'xterm' ;
23
23
24
24
25
- export interface IAccessibleContentProvider { id : string ; provideContent ( ) : string ; onClose ( ) : void ; onKeyDown ?( e : IKeyboardEvent ) : void ; options : IAccessibleViewOptions }
25
+ export interface IAccessibleContentProvider {
26
+ id : string ;
27
+ provideContent ( ) : string ;
28
+ onClose ( ) : void ;
29
+ onKeyDown ?( e : IKeyboardEvent ) : void ;
30
+ options : IAccessibleViewOptions ;
31
+ }
32
+
26
33
export const IAccessibleViewService = createDecorator < IAccessibleViewService > ( 'accessibleViewService' ) ;
27
34
28
35
export interface IAccessibleViewService {
@@ -96,7 +103,7 @@ class AccessibleView extends Disposable {
96
103
if ( ! domNode ) {
97
104
return ;
98
105
}
99
- container . appendChild ( domNode ) ;
106
+ container . appendChild ( this . _editorContainer ) ;
100
107
this . _layout ( ) ;
101
108
this . _register ( this . _editorWidget . onKeyDown ( ( e ) => {
102
109
if ( e . keyCode === KeyCode . Escape ) {
@@ -113,21 +120,16 @@ class AccessibleView extends Disposable {
113
120
}
114
121
115
122
private _layout ( ) : void {
116
- const domNode = this . _editorWidget . getDomNode ( ) ;
117
- if ( ! domNode ) {
118
- return ;
119
- }
120
-
121
123
const windowWidth = window . innerWidth ;
122
124
const windowHeight = window . innerHeight ;
123
125
124
126
const width = windowWidth * .4 ;
125
127
const height = Math . min ( .4 * windowHeight , this . _editorWidget . getContentHeight ( ) ) ;
126
128
this . _editorWidget . layout ( { width, height } ) ;
127
129
const top = Math . round ( ( windowHeight - height ) / 2 ) ;
128
- domNode . style . top = `${ top } px` ;
130
+ this . _editorContainer . style . top = `${ top } px` ;
129
131
const left = Math . round ( ( windowWidth - width ) / 2 ) ;
130
- domNode . style . left = `${ left } px` ;
132
+ this . _editorContainer . style . left = `${ left } px` ;
131
133
}
132
134
133
135
private async _getTextModel ( resource : URI ) : Promise < ITextModel | null > {
0 commit comments