@@ -287,28 +287,44 @@ class LyxeaDatatable<T>
287
287
const self = this ;
288
288
// @ts -ignore
289
289
config . drawCallback = function ( ) {
290
- const tabPosition = document . querySelector ( `${ self . _ref } _wrapper` ) as HTMLElement ;
290
+ const tabPosition = document . querySelector (
291
+ `${ self . _ref } _wrapper`
292
+ ) as HTMLElement ;
291
293
if ( tabPosition ) {
292
294
const tabTop = tabPosition . getBoundingClientRect ( ) . top ;
293
- const dtScrollHeadHeight = ( document . querySelector ( `${ self . _ref } _wrapper .dt-scroll-head` ) as HTMLElement ) . offsetHeight ;
294
- const dtScrollFootHeight = ( document . querySelector ( `${ self . _ref } _wrapper .dt-scroll-foot` ) as HTMLElement ) . offsetHeight ;
295
- const dtLayoutRows = document . querySelectorAll ( `${ self . _ref } _wrapper .dt-layout-row:not(.dt-layout-table)` ) ;
296
- const dtLayoutRowsHeight = Array . from ( dtLayoutRows ) . reduce ( ( acc , node ) => acc + ( node as HTMLElement ) . offsetHeight , 0 ) ;
297
- const myHeight = (
298
- window . innerHeight // La taille de la fenêtre complete
299
- - tabTop // L'ordonnée du haut du tableau
300
- - dtScrollHeadHeight // La taille du header
301
- - dtScrollFootHeight // La taille du footer
302
- - dtLayoutRowsHeight // La taille de toutes les rows
303
- - 10 // valeur statique pour assurer une marge
295
+ const dtScrollHeadHeight = (
296
+ document . querySelector (
297
+ `${ self . _ref } _wrapper .dt-scroll-head`
298
+ ) as HTMLElement
299
+ ) . offsetHeight ;
300
+ const dtScrollFootHeight = (
301
+ document . querySelector (
302
+ `${ self . _ref } _wrapper .dt-scroll-foot`
303
+ ) as HTMLElement
304
+ ) . offsetHeight ;
305
+ const dtLayoutRows = document . querySelectorAll (
306
+ `${ self . _ref } _wrapper .dt-layout-row:not(.dt-layout-table)`
304
307
) ;
305
- const dtScrollBody = document . querySelector ( `${ self . _ref } _wrapper .dt-scroll-body` ) as HTMLElement ;
306
- if ( ( tabTop + tabPosition . offsetHeight ) > window . innerHeight ) {
307
- dtScrollBody . style . minHeight = myHeight + "px" ;
308
- dtScrollBody . style . height = myHeight + "px" ;
308
+ const dtLayoutRowsHeight = Array . from ( dtLayoutRows ) . reduce (
309
+ ( acc , node ) => acc + ( node as HTMLElement ) . offsetHeight ,
310
+ 0
311
+ ) ;
312
+ const myHeight =
313
+ window . innerHeight - // La taille de la fenêtre complete
314
+ tabTop - // L'ordonnée du haut du tableau
315
+ dtScrollHeadHeight - // La taille du header
316
+ dtScrollFootHeight - // La taille du footer
317
+ dtLayoutRowsHeight - // La taille de toutes les rows
318
+ 10 ; // valeur statique pour assurer une marge
319
+ const dtScrollBody = document . querySelector (
320
+ `${ self . _ref } _wrapper .dt-scroll-body`
321
+ ) as HTMLElement ;
322
+ if ( tabTop + tabPosition . offsetHeight > window . innerHeight ) {
323
+ dtScrollBody . style . minHeight = myHeight + 'px' ;
324
+ dtScrollBody . style . height = myHeight + 'px' ;
309
325
}
310
326
}
311
- }
327
+ } ;
312
328
}
313
329
314
330
handleBootrapTabChange < T > ( instance : DataTable < T > ) {
0 commit comments