From 324e34fb129976d320da91bcc7b8763c1fb710d6 Mon Sep 17 00:00:00 2001 From: Adam Wight Date: Fri, 27 Sep 2024 12:33:28 +0200 Subject: [PATCH] Indent subrefs in the reuse search item list TODO: This can be merged as-is, since it only affects pages with subrefs, but it behaves surprisingly when the ref body is long. In this case, the text wraps around and flows onto the next lines unindented. A full implementation would require deeper changes to the item pane layout, which is happening in a separate patch. Recommend merging this as a quick visual fix and then we come back to the subref+long content edge case once the pane is easier to adjust layout in. Bug: T375841 Change-Id: I65510f1550e033e57a3493676d8fc24f628c0600 --- modules/ve-cite/ve.ui.MWReferenceSearchWidget.js | 3 +++ modules/ve-cite/ve.ui.MWReferenceSearchWidget.less | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/modules/ve-cite/ve.ui.MWReferenceSearchWidget.js b/modules/ve-cite/ve.ui.MWReferenceSearchWidget.js index 3b41d47e9..d1fc509b1 100644 --- a/modules/ve-cite/ve.ui.MWReferenceSearchWidget.js +++ b/modules/ve-cite/ve.ui.MWReferenceSearchWidget.js @@ -198,6 +198,9 @@ ve.ui.MWReferenceSearchWidget.prototype.buildSearchResults = function ( query ) const $footnoteLabel = $( '
' ) .addClass( 've-ui-mwReferenceSearchWidget-footnote' ) .text( '[' + item.footnoteLabel + ']' ); + if ( item.reference.extendsRef !== undefined ) { + $footnoteLabel.addClass( 've-ui-mwReferenceSearchWidget-footnote-sub' ); + } const $name = $( '
' ) .addClass( 've-ui-mwReferenceSearchWidget-name' ) .toggleClass( 've-ui-mwReferenceSearchWidget-name-autogenerated', /^:\d+$/.test( item.name ) ) diff --git a/modules/ve-cite/ve.ui.MWReferenceSearchWidget.less b/modules/ve-cite/ve.ui.MWReferenceSearchWidget.less index 0fe6c7ca4..f3a78352e 100644 --- a/modules/ve-cite/ve.ui.MWReferenceSearchWidget.less +++ b/modules/ve-cite/ve.ui.MWReferenceSearchWidget.less @@ -12,6 +12,11 @@ &-footnote { float: left; margin-right: 0.75em; + + // Class applied only to subrefs + &-sub { + margin-left: 2em; + } } // A reference's unique identifier as provided via the name="…" attribute