From: Moriel Schottlender Date: Thu, 24 Aug 2017 23:52:29 +0000 (-0700) Subject: RCFilters: Minimize vertical spacing; get rid of legend and
s X-Git-Tag: 1.31.0-rc.0~2238^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=8e099f54477ae6f4d5265281f96af05ea373db58;p=lhc%2Fweb%2Fwiklou.git RCFilters: Minimize vertical spacing; get rid of legend and
s Bug: T174121 Change-Id: I2249bf3d313232fe2f0dff6e34c5140885a13735 --- 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(); } };