Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/190939

Change subject: TextInputWidget: Don't add label position classes when there's 
no label
......................................................................

TextInputWidget: Don't add label position classes when there's no label

In JavaScript, `null && foo` is always `null`, and in jQuery,
$el.toggleClass( 'foo', null ) adds the class rather than remove it.

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


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/39/190939/1

diff --git a/src/widgets/TextInputWidget.js b/src/widgets/TextInputWidget.js
index b6ff126..6b2df7b 100644
--- a/src/widgets/TextInputWidget.js
+++ b/src/widgets/TextInputWidget.js
@@ -367,8 +367,8 @@
        var after = this.labelPosition === 'after';
 
        this.$element
-               .toggleClass( 'oo-ui-textInputWidget-labelPosition-after', 
this.label && after )
-               .toggleClass( 'oo-ui-textInputWidget-labelPosition-before', 
this.label && !after );
+               .toggleClass( 'oo-ui-textInputWidget-labelPosition-after', 
!!this.label && after )
+               .toggleClass( 'oo-ui-textInputWidget-labelPosition-before', 
!!this.label && !after );
 
        if ( this.label ) {
                this.positionLabel();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71a26861a418201bc9380341ec24e63e08ae4123
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to