/*!
- * OOUI v0.29.5
+ * OOUI v0.30.2
* https://www.mediawiki.org/wiki/OOUI
*
- * Copyright 2011–2018 OOUI Team and other contributors.
+ * Copyright 2011–2019 OOUI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2018-11-08T22:38:07Z
+ * Date: 2019-01-23T01:14:20Z
*/
( function ( OO ) {
* return this.panel1.$element.outerHeight( true );
* };
* var windowManager = new OO.ui.WindowManager();
- * $( 'body' ).append( windowManager.$element );
+ * $( document.body ).append( windowManager.$element );
* var dialog = new MyProcessDialog( {
* size: 'medium'
* } );
config = config || {};
// Properties
- this.message = message instanceof jQuery ? message : String( message );
+ this.message = message instanceof $ ? message : String( message );
this.recoverable = config.recoverable === undefined || !!config.recoverable;
this.warning = !!config.warning;
};
* @return {jQuery} Error message in DOM nodes
*/
OO.ui.Error.prototype.getMessage = function () {
- return this.message instanceof jQuery ?
+ return this.message instanceof $ ?
this.message.clone() :
$( '<div>' ).text( this.message ).contents();
};
* @return {string} Error message
*/
OO.ui.Error.prototype.getMessageText = function () {
- return this.message instanceof jQuery ? this.message.text() : this.message;
+ return this.message instanceof $ ? this.message.text() : this.message;
};
/**
return $.Deferred().reject( result ).promise();
}
// Duck-type the object to see if it can produce a promise
- if ( result && $.isFunction( result.promise ) ) {
+ if ( result && typeof result.promise === 'function' ) {
// Use a promise generated from the result
return result.promise();
}
* @return {Object} Step object, with `callback` and `context` properties
*/
OO.ui.Process.prototype.createStep = function ( step, context ) {
- if ( typeof step === 'number' || $.isFunction( step.promise ) ) {
+ if ( typeof step === 'number' || typeof step.promise === 'function' ) {
return {
callback: function () {
return step;
context: null
};
}
- if ( $.isFunction( step ) ) {
+ if ( typeof step === 'function' ) {
return {
callback: step,
context: context
* Example:
*
* var windowManager = new OO.ui.WindowManager();
- * $( 'body' ).append( windowManager.$element );
+ * $( document.body ).append( windowManager.$element );
*
* // Add a window under the default name: see OO.ui.MessageDialog.static.name
* windowManager.addWindows( [ new OO.ui.MessageDialog() ] );
if ( stackDepth === 0 ) {
scrollWidth = window.innerWidth - document.documentElement.clientWidth;
bodyMargin = parseFloat( $body.css( 'margin-right' ) ) || 0;
- $body.css( {
- overflow: 'hidden',
- position: 'relative',
- 'margin-right': bodyMargin + scrollWidth
- } );
+ $body.addClass( 'oo-ui-windowManager-modal-active' );
+ $body.css( 'margin-right', bodyMargin + scrollWidth );
}
stackDepth++;
this.globalEvents = true;
} );
stackDepth--;
if ( stackDepth === 0 ) {
- $body.css( {
- overflow: '',
- position: '',
- 'margin-right': ''
- } );
+ $body.removeClass( 'oo-ui-windowManager-modal-active' );
+ $body.css( 'margin-right', '' );
}
this.globalEvents = false;
}
this.$element.removeAttr( 'aria-hidden' );
// Hide everything other than the window manager from screen readers
- this.$ariaHidden = $( 'body' )
+ this.$ariaHidden = $( document.body )
.children()
.not( 'script' )
.not( $topLevelElement )
// Blur the focused element
if ( $focus.length ) {
+ // eslint-disable-next-line jquery/no-event-shorthand
$focus[ 0 ].blur();
}
* } );
* // Create and append a window manager, which opens and closes the window.
* var windowManager = new OO.ui.WindowManager();
- * $( 'body' ).append( windowManager.$element );
+ * $( document.body ).append( windowManager.$element );
* windowManager.addWindows( [ myDialog ] );
* // Open the window!
* windowManager.openWindow( myDialog );
*
* // Create and append a window manager.
* var windowManager = new OO.ui.WindowManager();
- * $( 'body' ).append( windowManager.$element );
+ * $( document.body ).append( windowManager.$element );
* windowManager.addWindows( [ messageDialog ] );
* // Open the window.
* windowManager.openWindow( messageDialog, {
* };
*
* var windowManager = new OO.ui.WindowManager();
- * $( 'body' ).append( windowManager.$element );
+ * $( document.body ).append( windowManager.$element );
*
* var dialog = new MyProcessDialog();
* windowManager.addWindows( [ dialog ] );
// Events
this.dismissButton.connect( this, { click: 'onDismissErrorButtonClick' } );
this.retryButton.connect( this, { click: 'onRetryButtonClick' } );
+ this.title.connect( this, { labelChange: 'fitLabel' } );
// Initialization
this.title.$element.addClass( 'oo-ui-processDialog-title' );
OO.ui.getWindowManager = function () {
if ( !OO.ui.windowManager ) {
OO.ui.windowManager = new OO.ui.WindowManager();
- $( 'body' ).append( OO.ui.windowManager.$element );
+ $( document.body ).append( OO.ui.windowManager.$element );
OO.ui.windowManager.addWindows( [ new OO.ui.MessageDialog() ] );
}
return OO.ui.windowManager;