Update OOjs UI to v0.1.0-pre (98cecf304d)
authorJames D. Forrester <jforrester@wikimedia.org>
Wed, 15 Oct 2014 22:39:38 +0000 (15:39 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Wed, 15 Oct 2014 22:39:38 +0000 (15:39 -0700)
New changes:
98cecf3 Support MenuWidget's config.widget being in a different document

Change-Id: Ifc30790e67926bbdda0a8d5ec9464e7046f984ea

resources/lib/oojs-ui/oojs-ui-apex.css
resources/lib/oojs-ui/oojs-ui-apex.js
resources/lib/oojs-ui/oojs-ui-apex.svg.css
resources/lib/oojs-ui/oojs-ui-mediawiki.css
resources/lib/oojs-ui/oojs-ui-mediawiki.js
resources/lib/oojs-ui/oojs-ui-mediawiki.svg.css
resources/lib/oojs-ui/oojs-ui-minerva.css
resources/lib/oojs-ui/oojs-ui-minerva.js
resources/lib/oojs-ui/oojs-ui-minerva.svg.css
resources/lib/oojs-ui/oojs-ui.js

index 42e6699..ae09ca1 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:39:34Z
  */
 /* @noflip */
 .oo-ui-rtl {
index ba1ef86..9f68e75 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:17Z
+ * Date: 2014-10-15T22:39:24Z
  */
 /* Instantiation */
 
index 06880ff..8ee3096 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:39:34Z
  */
 /* @noflip */
 .oo-ui-rtl {
index 7fbd762..2890807 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:39:34Z
  */
 /* @noflip */
 .oo-ui-rtl {
index 8fed983..5524abe 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:17Z
+ * Date: 2014-10-15T22:39:24Z
  */
 /**
  * @class
index 266d714..d0a455a 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:39:34Z
  */
 /* @noflip */
 .oo-ui-rtl {
index 8feccb9..030a207 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:39:34Z
  */
 /* @noflip */
 .oo-ui-rtl {
index ba1ef86..9f68e75 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:17Z
+ * Date: 2014-10-15T22:39:24Z
  */
 /* Instantiation */
 
index ad1316c..45d32e8 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:39:34Z
  */
 /* @noflip */
 .oo-ui-rtl {
index 50f69f3..925585c 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (98cecf304d)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:17Z
+ * Date: 2014-10-15T22:39:24Z
  */
 ( function ( OO ) {
 
@@ -11181,7 +11181,9 @@ OO.ui.MenuWidget.prototype.toggle = function ( visible ) {
        visible = ( visible === undefined ? !this.visible : !!visible ) && !!this.items.length;
 
        var i, len,
-               change = visible !== this.isVisible();
+               change = visible !== this.isVisible(),
+               elementDoc = this.getElementDocument(),
+               widgetDoc = this.$widget ? this.$widget[0].ownerDocument : null;
 
        // Parent method
        OO.ui.MenuWidget.super.prototype.toggle.call( this, visible );
@@ -11205,9 +11207,15 @@ OO.ui.MenuWidget.prototype.toggle = function ( visible ) {
 
                        // Auto-hide
                        if ( this.autoHide ) {
-                               this.getElementDocument().addEventListener(
+                               elementDoc.addEventListener(
                                        'mousedown', this.onDocumentMouseDownHandler, true
                                );
+                               // Support $widget being in a different document
+                               if ( widgetDoc && widgetDoc !== elementDoc ) {
+                                       widgetDoc.addEventListener(
+                                               'mousedown', this.onDocumentMouseDownHandler, true
+                                       );
+                               }
                        }
                } else {
                        this.unbindKeyDownListener();
@@ -11215,9 +11223,15 @@ OO.ui.MenuWidget.prototype.toggle = function ( visible ) {
                                this.$previousFocus[0].focus();
                                this.$previousFocus = null;
                        }
-                       this.getElementDocument().removeEventListener(
+                       elementDoc.removeEventListener(
                                'mousedown', this.onDocumentMouseDownHandler, true
                        );
+                       // Support $widget being in a different document
+                       if ( widgetDoc && widgetDoc !== elementDoc ) {
+                               widgetDoc.removeEventListener(
+                                       'mousedown', this.onDocumentMouseDownHandler, true
+                               );
+                       }
                        this.toggleClipping( false );
                }
        }