jenkins-bot has submitted this change and it was merged.

Change subject: TextInputWidget: Only put $label in the DOM if needed
......................................................................


TextInputWidget: Only put $label in the DOM if needed

Full disclosure: my only motivation for doing this is making the
JS/PHP comparison tests pass. This is easier than adding support for
labels in PHP, and we couldn't support them well there.

Change-Id: I806351b25d1d5c5ca6b7e0d412ef8f86b9964e39
---
M src/widgets/TextInputWidget.js
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Jforrester: Looks good to me, but someone else must approve
  Esanders: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/widgets/TextInputWidget.js b/src/widgets/TextInputWidget.js
index 2d3ee3a..831bc78 100644
--- a/src/widgets/TextInputWidget.js
+++ b/src/widgets/TextInputWidget.js
@@ -72,7 +72,7 @@
        // Initialization
        this.$element
                .addClass( 'oo-ui-textInputWidget' )
-               .append( this.$icon, this.$indicator, this.$label );
+               .append( this.$icon, this.$indicator );
        this.setReadOnly( !!config.readOnly );
        if ( config.placeholder ) {
                this.$input.attr( 'placeholder', config.placeholder );
@@ -391,7 +391,10 @@
                        'padding-left': ''
                } );
 
-       if ( !this.$label.text() ) {
+       if ( this.label ) {
+               this.$element.append( this.$label );
+       } else {
+               this.$label.detach();
                return;
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/190944
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I806351b25d1d5c5ca6b7e0d412ef8f86b9964e39
Gerrit-PatchSet: 2
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <matma....@gmail.com>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Trevor Parscal <tpars...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to