File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,38 @@ function render({ model, el }) {
237237 }
238238 } ) ;
239239
240+ // Add hover effect for flattened rows
241+ const rows = tableContainer . querySelectorAll ( 'tbody tr' ) ;
242+ rows . forEach ( ( row ) => {
243+ row . addEventListener ( 'mouseover' , ( ) => {
244+ const origRow = row . getAttribute ( 'data-orig-row' ) ;
245+ if ( origRow !== null ) {
246+ const groupRows = tableContainer . querySelectorAll (
247+ `tr[data-orig-row="${ origRow } "]` ,
248+ ) ;
249+ groupRows . forEach ( ( r ) => {
250+ r . querySelectorAll ( 'td' ) . forEach ( ( cell ) => {
251+ cell . classList . add ( 'row-hover' ) ;
252+ } ) ;
253+ } ) ;
254+ }
255+ } ) ;
256+
257+ row . addEventListener ( 'mouseout' , ( ) => {
258+ const origRow = row . getAttribute ( 'data-orig-row' ) ;
259+ if ( origRow !== null ) {
260+ const groupRows = tableContainer . querySelectorAll (
261+ `tr[data-orig-row="${ origRow } "]` ,
262+ ) ;
263+ groupRows . forEach ( ( r ) => {
264+ r . querySelectorAll ( 'td' ) . forEach ( ( cell ) => {
265+ cell . classList . remove ( 'row-hover' ) ;
266+ } ) ;
267+ } ) ;
268+ }
269+ } ) ;
270+ } ) ;
271+
240272 updateButtonStates ( ) ;
241273 }
242274
You can’t perform that action at this time.
0 commit comments