From 8e099f54477ae6f4d5265281f96af05ea373db58 Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Thu, 24 Aug 2017 16:52:29 -0700 Subject: [PATCH] RCFilters: Minimize vertical spacing; get rid of legend and
s Bug: T174121 Change-Id: I2249bf3d313232fe2f0dff6e34c5140885a13735 --- .../ui/mw.rcfilters.ui.FormWrapperWidget.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js index ad99e223cd..cfcdf353a9 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js @@ -142,11 +142,14 @@ this.$element.find( 'hr' ).detach(); } + // Get rid of all
s, which are inside rcshowhide + // If we still have content in rcshowhide, the
s are + // gone. Instead, the CSS now has a rule to mark all s + // inside .rcshowhide with display:block; to simulate newlines + // where they're actually needed. + this.$element.find( 'br' ).detach(); if ( !this.$element.find( '.rcshowhide' ).contents().length ) { this.$element.find( '.rcshowhide' ).detach(); - // If we're hiding rcshowhide, the '
's are around it, - // there's no need for them either. - this.$element.find( 'br' ).detach(); } if ( this.$element.find( '.cloption' ).text().trim() === '' ) { @@ -157,7 +160,11 @@ '.rclistfrom, .rcnotefrom, .rcoptions-listfromreset' ).detach(); - if ( this.$element.text().trim() === this.$element.find( 'legend' ).text() ) { + // Get rid of the legend + this.$element.find( 'legend' ).detach(); + + // Check if the element is essentially empty, and detach it if it is + if ( !this.$element.text().trim().length ) { this.$element.detach(); } }; -- 2.20.1