X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.rcfilters%2Fui%2Fmw.rcfilters.ui.FormWrapperWidget.js;h=83905d5be92ce6b504fd950176f9727ef35395c4;hb=be99787e5b216247ffbc26a7f90e27ac985fff4f;hp=ad99e223cd739c2846cd6eb1590cecb01b2c95e2;hpb=ed1966c1ed85f7ec713dc252f8c526b8f0e42505;p=lhc%2Fweb%2Fwiklou.git
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..83905d5be9 100644
--- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
@@ -87,7 +87,6 @@
*/
mw.rcfilters.ui.FormWrapperWidget.prototype.onChangesModelInvalidate = function () {
this.$submitButton.prop( 'disabled', true );
- this.$element.removeClass( 'mw-rcfilters-ui-ready' );
};
/**
@@ -100,7 +99,6 @@
*/
mw.rcfilters.ui.FormWrapperWidget.prototype.onChangesModelUpdate = function ( $changesList, $fieldset, isInitialDOM ) {
this.$submitButton.prop( 'disabled', false );
- this.$element.removeClass( 'mw-rcfilters-ui-ready' );
// Replace the entire fieldset
this.$element.empty().append( $fieldset.contents() );
@@ -142,11 +140,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 +158,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();
}
};