@@ -16,7 +16,7 @@ import "ace-builds/src-min-noconflict/theme-xcode";
16
16
const Range = ace . require ( "ace/range" ) . Range ;
17
17
18
18
export class App {
19
- get contentMaxHeight ( ) {
19
+ get contentViewHeight ( ) {
20
20
const headerHeight = document . querySelector ( "header" ) . clientHeight ;
21
21
const footerHeight = document . querySelector ( "footer" ) . clientHeight ;
22
22
return `calc(100vh - ${ headerHeight } px - ${ footerHeight } px)` ;
@@ -133,6 +133,13 @@ export class App {
133
133
false
134
134
) ;
135
135
136
+ const onresize = debounce ( ( ) => {
137
+ this . onresize ( ) ;
138
+ } , 200 ) ;
139
+ new ResizeObserver ( ( ) => {
140
+ onresize ( ) ;
141
+ } ) . observe ( document . body ) ;
142
+
136
143
this . update ( ) ;
137
144
}
138
145
@@ -179,19 +186,12 @@ export class App {
179
186
} , [ ] ) ;
180
187
this . updateStatistics ( statistics ) ;
181
188
182
- document . getElementById ( "structure" ) . style . maxHeight =
183
- this . contentMaxHeight ;
184
- document . getElementById ( "syntax-container" ) . style . maxHeight =
185
- this . contentMaxHeight ;
186
- document . getElementById ( "statistics-container" ) . style . maxHeight =
187
- this . contentMaxHeight ;
189
+ this . onresize ( ) ;
188
190
} )
189
191
. catch ( ( error ) => {
190
- if ( error . status == 413 ) {
191
- alert ( "Payload Too Large" ) ;
192
- } else {
193
- alert ( "Something went wrong" ) ;
194
- }
192
+ this . structureView . error = error ;
193
+ this . syntaxView . error = error ;
194
+ this . statisticsView . error = error ;
195
195
} )
196
196
. finally ( ( ) => {
197
197
hideLoading ( ) ;
@@ -241,6 +241,14 @@ export class App {
241
241
}
242
242
} ;
243
243
}
244
+
245
+ onresize ( ) {
246
+ document . getElementById ( "structure" ) . style . height = this . contentViewHeight ;
247
+ document . getElementById ( "syntax-container" ) . style . height =
248
+ this . contentViewHeight ;
249
+ document . getElementById ( "statistics-container" ) . style . height =
250
+ this . contentViewHeight ;
251
+ }
244
252
}
245
253
246
254
function configurations ( ) {
0 commit comments