File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed
Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -132,19 +132,27 @@ jQuery3(document).ready(function () {
132132 } ) ;
133133
134134 table . on ( 'draw.dt' , function ( ) {
135+ // Re-enable tooltips
135136 table . find ( '[data-bs-toggle="tooltip"]' ) . each ( function ( ) {
136137 const tooltip = new bootstrap5 . Tooltip ( $ ( this ) [ 0 ] ) ;
137138 tooltip . enable ( ) ;
138139 } ) ;
139- table . find ( '.details-icon-close' ) . each ( function ( ) {
140- $ ( this ) . hide ( ) ;
141- } ) ;
142- table . find ( '.details-icon-open' ) . each ( function ( ) {
143- $ ( this ) . show ( ) ;
144- } ) ;
145- table . rows ( ) . every ( function ( ) {
146- this . child . hide ( ) ;
147- } ) ;
140+
141+ // Re-draw details icon state
142+ dataTable . rows ( ) . every ( function ( rowIndex , tableLoop , rowLoop ) {
143+ const tr = $ ( this . node ( ) ) ;
144+ const openRowButton = tr . find ( '.details-icon-open' ) ;
145+ const closeRowButton = tr . find ( '.details-icon-close' ) ;
146+
147+ if ( this . child . isShown ( ) ) {
148+ openRowButton . hide ( ) ;
149+ closeRowButton . show ( ) ;
150+ }
151+ else {
152+ openRowButton . show ( ) ;
153+ closeRowButton . hide ( ) ;
154+ }
155+ } ) ;
148156 } ) ;
149157
150158 if ( table . is ( ":visible" ) ) {
@@ -156,7 +164,8 @@ jQuery3(document).ready(function () {
156164 } ) ;
157165 }
158166
159- // Since Jenkins 2.406 Prototype has been removed from core.
167+ // TODO: Remove this block once Jenkins 2.426.1 is released
168+ // Since Jenkins 2.406 Prototype has been removed.
160169 // So we basically do not need to support a custom serialization of the data-tables state
161170 // anymore. We can now use the default auto-save functionality of DataTables.
162171 if ( typeof Prototype === 'object' ) {
You can’t perform that action at this time.
0 commit comments