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

Change subject: TextInputWidget: Don't call #updatePosition if there's no label 
to position
......................................................................


TextInputWidget: Don't call #updatePosition if there's no label to position

If there is no label and we only change the position, #updatePosition
is a no-op, but it takes really a lot of work to do nothing.
#setLabelPosition is called from the constructor, making this expensive.

Bug: T126783
Change-Id: I9e035a4556130dfe2cecb45527fd434b6f4c9846
---
M src/widgets/TextInputWidget.js
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Esanders: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/widgets/TextInputWidget.js b/src/widgets/TextInputWidget.js
index f3ceaf4..9d775b7 100644
--- a/src/widgets/TextInputWidget.js
+++ b/src/widgets/TextInputWidget.js
@@ -737,7 +737,11 @@
  */
 OO.ui.TextInputWidget.prototype.setLabelPosition = function ( labelPosition ) {
        this.labelPosition = labelPosition;
-       this.updatePosition();
+       if ( this.label ) {
+               // If there is no label and we only change the position, 
#updatePosition is a no-op,
+               // but it takes really a lot of work to do nothing.
+               this.updatePosition();
+       }
        return this;
 };
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9e035a4556130dfe2cecb45527fd434b6f4c9846
Gerrit-PatchSet: 4
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to