aboutsummaryrefslogtreecommitdiffstats
path: root/resources/lib/oojs-ui/oojs-ui.js
diff options
context:
space:
mode:
authorJames D. Forrester <jforrester@wikimedia.org>2014-04-29 17:13:15 -0700
committerJames D. Forrester <jforrester@wikimedia.org>2014-04-29 17:13:15 -0700
commit8c6814e05abc6e06b3d7a34de78f30e355b9b87b (patch)
tree5762c9b3c8d21feb85686bf558101c34d67b65d9 /resources/lib/oojs-ui/oojs-ui.js
parent1abe2525cda430bbe99bd370490882067896a300 (diff)
downloadmediawikicore-8c6814e05abc6e06b3d7a34de78f30e355b9b87b.tar.gz
mediawikicore-8c6814e05abc6e06b3d7a34de78f30e355b9b87b.zip
Update OOjs UI to v0.1.0-pre (70f1886a35)
New changes: c486e35 Add info icon and alert indicator 5928259 Add a 'ready' event to the window open sequence d2f1933 Improve info and alert icons/indicators 6d78021 Defer window 'ready' event to let rendering happen 7705a94 Add focus method to SearchWidget 70f1886 Improve alert and required indicators Change-Id: I58ae4c8154d45b34e2dcd404a5d8c3c9bbffd32f
Diffstat (limited to 'resources/lib/oojs-ui/oojs-ui.js')
-rw-r--r--resources/lib/oojs-ui/oojs-ui.js29
1 files changed, 21 insertions, 8 deletions
diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js
index 60476d51a087..d965ffa7ade8 100644
--- a/resources/lib/oojs-ui/oojs-ui.js
+++ b/resources/lib/oojs-ui/oojs-ui.js
@@ -1,12 +1,12 @@
/*!
- * OOjs UI v0.1.0-pre (b91660e612)
+ * OOjs UI v0.1.0-pre (70f1886a35)
* 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: Mon Apr 28 2014 12:57:47 GMT-0700 (PDT)
+ * Date: Tue Apr 29 2014 17:13:10 GMT-0700 (PDT)
*/
( function ( OO ) {
@@ -1297,7 +1297,9 @@ OO.ui.Window.prototype.teardown = function () {
* Do not override this method. See #setup for a way to make changes each time the window opens.
*
* @param {Object} [data] Window opening data
+ * @fires opening
* @fires open
+ * @fires ready
* @chainable
*/
OO.ui.Window.prototype.open = function ( data ) {
@@ -1308,13 +1310,16 @@ OO.ui.Window.prototype.open = function ( data ) {
this.visible = true;
this.emit( 'opening', data );
this.setup( data );
- // Focus the content div (which has a tabIndex) to inactivate
- // (but not clear) selections in the parent frame.
- // Must happen after setup runs (otherwise focusing it doesn't work)
- // but before 'open' is emitted (so subclasses can give focus to something else)
- this.frame.$content.focus();
this.emit( 'open', data );
- this.opening = false;
+ setTimeout( OO.ui.bind( function () {
+ // Focus the content div (which has a tabIndex) to inactivate
+ // (but not clear) selections in the parent frame.
+ // Must happen after 'open' is emitted (to ensure it is visible)
+ // but before 'ready' is emitted (so subclasses can give focus to something else)
+ this.frame.$content.focus();
+ this.emit( 'ready', data );
+ this.opening = false;
+ }, this ) );
}, this ) );
}
@@ -1327,6 +1332,7 @@ OO.ui.Window.prototype.open = function ( data ) {
* See #teardown for a way to do something each time the window closes.
*
* @param {Object} [data] Window closing data
+ * @fires closing
* @fires close
* @chainable
*/
@@ -7789,6 +7795,13 @@ OO.ui.SearchWidget.prototype.clear = function () {
};
/**
+ * Focus the query input.
+ */
+OO.ui.SearchWidget.prototype.focus = function () {
+ this.query.$input[0].focus();
+};
+
+/**
* Get the results list.
*
* @return {OO.ui.SelectWidget} Select list