Catrope has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/333821 )
Change subject: Follow-up d21cf8a: unbreak popups with no $floatableContainer
......................................................................
Follow-up d21cf8a: unbreak popups with no $floatableContainer
* Prevent positioning from being enabled for popups with no
$floatableContainer due to true&&undefined === undefined
* Prevent JS error in togglePositioning when $floatableContainer
is not set
Change-Id: I5de8d4d40ee5ac945695204200c1d5dc1595fd93
---
M src/mixins/FloatableElement.js
M src/widgets/PopupWidget.js
2 files changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/21/333821/1
diff --git a/src/mixins/FloatableElement.js b/src/mixins/FloatableElement.js
index ced8660..2fae3a2 100644
--- a/src/mixins/FloatableElement.js
+++ b/src/mixins/FloatableElement.js
@@ -79,6 +79,10 @@
OO.ui.mixin.FloatableElement.prototype.togglePositioning = function (
positioning ) {
var closestScrollableOfContainer;
+ if ( !this.$floatable || !this.$floatableContainer ) {
+ return this;
+ }
+
positioning = positioning === undefined ? !this.positioning :
!!positioning;
if ( this.positioning !== positioning ) {
diff --git a/src/widgets/PopupWidget.js b/src/widgets/PopupWidget.js
index 5aa33b4..23d6dc8 100644
--- a/src/widgets/PopupWidget.js
+++ b/src/widgets/PopupWidget.js
@@ -256,7 +256,7 @@
OO.ui.PopupWidget.parent.prototype.toggle.call( this, show );
if ( change ) {
- this.togglePositioning( show && this.$floatableContainer );
+ this.togglePositioning( show && !!this.$floatableContainer );
if ( show ) {
if ( this.autoClose ) {
--
To view, visit https://gerrit.wikimedia.org/r/333821
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5de8d4d40ee5ac945695204200c1d5dc1595fd93
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits