Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/270966
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.
Change-Id: I9e035a4556130dfe2cecb45527fd434b6f4c9846
---
M src/widgets/TextInputWidget.js
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/66/270966/1
diff --git a/src/widgets/TextInputWidget.js b/src/widgets/TextInputWidget.js
index 895ffa2..d0f0c90 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: newchange
Gerrit-Change-Id: I9e035a4556130dfe2cecb45527fd434b6f4c9846
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