Update OOjs UI to v0.17.0
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui-windows.js
index f07f11e..7f33fad 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.16.1
+ * OOjs UI v0.17.0
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2016 OOjs UI Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2016-03-01T21:50:12Z
+ * Date: 2016-04-26T21:34:01Z
  */
 ( function ( OO ) {
 
@@ -2060,9 +2060,9 @@ OO.ui.Window.prototype.updateSize = function () {
  * @param {string|number} [dim.width] Width
  * @param {string|number} [dim.minWidth] Minimum width
  * @param {string|number} [dim.maxWidth] Maximum width
- * @param {string|number} [dim.width] Height, omit to set based on height of contents
- * @param {string|number} [dim.minWidth] Minimum height
- * @param {string|number} [dim.maxWidth] Maximum height
+ * @param {string|number} [dim.height] Height, omit to set based on height of contents
+ * @param {string|number} [dim.minHeight] Minimum height
+ * @param {string|number} [dim.maxHeight] Maximum height
  * @chainable
  */
 OO.ui.Window.prototype.setDimensions = function ( dim ) {
@@ -2417,10 +2417,18 @@ OO.ui.Dialog.static.escapable = true;
  * @param {jQuery.Event} e Key down event
  */
 OO.ui.Dialog.prototype.onDialogKeyDown = function ( e ) {
-       if ( e.which === OO.ui.Keys.ESCAPE ) {
+       var actions;
+       if ( e.which === OO.ui.Keys.ESCAPE && this.constructor.static.escapable ) {
                this.executeAction( '' );
                e.preventDefault();
                e.stopPropagation();
+       } else if ( e.which === OO.ui.Keys.ENTER && e.ctrlKey ) {
+               actions = this.actions.get( { flags: 'primary', visible: true, disabled: false } );
+               if ( actions.length > 0 ) {
+                       this.executeAction( actions[ 0 ].getAction() );
+                       e.preventDefault();
+                       e.stopPropagation();
+               }
        }
 };
 
@@ -2511,9 +2519,7 @@ OO.ui.Dialog.prototype.getSetupProcess = function ( data ) {
                        );
                        this.actions.add( this.getActionWidgets( actions ) );
 
-                       if ( this.constructor.static.escapable ) {
-                               this.$element.on( 'keydown', this.onDialogKeyDownHandler );
-                       }
+                       this.$element.on( 'keydown', this.onDialogKeyDownHandler );
                }, this );
 };
 
@@ -2524,9 +2530,7 @@ OO.ui.Dialog.prototype.getTeardownProcess = function ( data ) {
        // Parent method
        return OO.ui.Dialog.parent.prototype.getTeardownProcess.call( this, data )
                .first( function () {
-                       if ( this.constructor.static.escapable ) {
-                               this.$element.off( 'keydown', this.onDialogKeyDownHandler );
-                       }
+                       this.$element.off( 'keydown', this.onDialogKeyDownHandler );
 
                        this.actions.clear();
                        this.currentAction = null;