/*!
- * 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 ) {
* @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 ) {
* @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();
+ }
}
};
);
this.actions.add( this.getActionWidgets( actions ) );
- if ( this.constructor.static.escapable ) {
- this.$element.on( 'keydown', this.onDialogKeyDownHandler );
- }
+ this.$element.on( 'keydown', this.onDialogKeyDownHandler );
}, this );
};
// 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;