From: Roan Kattouw Date: Tue, 19 Sep 2017 21:41:26 +0000 (-0700) Subject: RCFilters: Don't remove mw-changeslist-line-prefix in enhanced mode X-Git-Tag: 1.31.0-rc.0~2029^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=46fd9c4ee711bf8026a5a49d1173921ece039a6b;p=lhc%2Fweb%2Fwiklou.git RCFilters: Don't remove mw-changeslist-line-prefix in enhanced mode It contains the 'x' buttons to unwatch pages when the relevant preference is enabled, so we shouldn't remove it. To make the table still work, we have to add an extra to the nested rows, and start the highlight one row later. Bug: T176264 Change-Id: Ie8eb913d55165ad2c548230cd61cd9ee189d9504 --- diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less index b4e3b0e493..6c8ebac658 100644 --- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less +++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less @@ -51,7 +51,7 @@ .mw-rcfilters-ui-changesListWrapperWidget li&, .mw-rcfilters-ui-changesListWrapperWidget & tr:first-child, .mw-rcfilters-ui-changesListWrapperWidget tr&.mw-rcfilters-ui-changesListWrapperWidget-enhanced-toplevel:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not( :nth-child( -n+2 ) ), - .mw-rcfilters-ui-changesListWrapperWidget tr&.mw-rcfilters-ui-changesListWrapperWidget-enhanced-nested:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not( :nth-child( -n+3 ) ) { + .mw-rcfilters-ui-changesListWrapperWidget tr&.mw-rcfilters-ui-changesListWrapperWidget-enhanced-nested:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not( :nth-child( -n+4 ) ) { background-color: @bgcolor; } } diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js index f331f75edb..b0550b2a94 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js @@ -312,14 +312,17 @@ ); // We are adding and changing cells in a table that, despite having nested rows, - // is actually all one big table. To do that right, we want to remove the 'placeholder' - // cell from the top row, because we're actually adding that placeholder in the children - // with the highlights. - $content.find( 'table.mw-enhanced-rc tr:first-child td.mw-changeslist-line-prefix' ) - .detach(); + // is actually all one big table. To prevent the highlights cell in the "nested" + // rows from stretching out the cell with the flags and timestamp in the top row, + // we give the latter colspan=2. Then to make things line up again, we add + // an empty to the "nested" rows. + + // Set colspan=2 on cell with flags and timestamp in top row $content.find( 'table.mw-enhanced-rc tr:first-child td.mw-enhanced-rc' ) .prop( 'colspan', '2' ); - + // Add empty to nested rows to compensate + $enhancedNestedPagesCell.parent().prepend( $( '' ) ); + // Add highlights cell to nested rows $enhancedNestedPagesCell .before( $( '' ) @@ -329,7 +332,7 @@ // We need to target the nested rows differently than the top rows so that the // LESS rules applies correctly. In top rows, the rule should highlight all but // the first 2 cells td:not( :nth-child( -n+2 ) and the nested rows, the rule - // should highlight all but the first 3 cells td:not( :nth-child( -n+3 ) + // should highlight all but the first 4 cells td:not( :nth-child( -n+4 ) $enhancedNestedPagesCell .closest( 'tr' ) .addClass( 'mw-rcfilters-ui-changesListWrapperWidget-enhanced-nested' );