From b4b2523f48a2480f2e13a0bbfab55698b9d40769 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 29 Sep 2015 02:35:06 +0200 Subject: [PATCH] OOjs UI: Backport d190bc51e60195eed81f147e9324c9ec21c9e68c Required for mw.widgets.DateInputWidget when used with '$overlay' config option, new in I504f81f843e8328f609824d44f276296645d5dd1. Change-Id: Ib494c58b9dcaecba62e1aaf501880b85452b7826 --- resources/lib/oojs-ui/oojs-ui.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js index 42bf82196d..03c2c1d8ba 100644 --- a/resources/lib/oojs-ui/oojs-ui.js +++ b/resources/lib/oojs-ui/oojs-ui.js @@ -1,3 +1,11 @@ +/* + * Local backports: + * + * - d190bc51e60195eed81f147e9324c9ec21c9e68c + * FloatableElement: Don't try unbinding events before we bind them + * Required for mw.widgets.DateInputWidget when used with '$overlay' config option. + */ + /*! * OOjs UI v0.12.9 * https://www.mediawiki.org/wiki/OOjs_UI @@ -6933,8 +6941,10 @@ OO.ui.mixin.FloatableElement.prototype.togglePositioning = function ( positionin // Initial position after visible this.position(); } else { - this.$floatableWindow.off( 'resize', this.onFloatableWindowResizeHandler ); - this.$floatableWindow = null; + if ( this.$floatableWindow ) { + this.$floatableWindow.off( 'resize', this.onFloatableWindowResizeHandler ); + this.$floatableWindow = null; + } if ( this.$floatableClosestScrollable ) { this.$floatableClosestScrollable.off( 'scroll', this.onFloatableScrollHandler ); -- 2.20.1