/*!
- * OOUI v0.31.3
+ * OOUI v0.31.4
* https://www.mediawiki.org/wiki/OOUI
*
* Copyright 2011–2019 OOUI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2019-04-04T19:10:48Z
+ * Date: 2019-04-16T23:14:51Z
*/
( function ( OO ) {
* @abstract
*
* @constructor
+ * @param {Object} [config] Configuration options
+ * @cfg {boolean} [showPendingRequest=true] Show pending state while request data is being fetched.
+ * Requires widget to have also mixed in {@link OO.ui.mixin.PendingElement}.
*/
-OO.ui.mixin.RequestManager = function OoUiMixinRequestManager() {
+OO.ui.mixin.RequestManager = function OoUiMixinRequestManager( config ) {
this.requestCache = {};
this.requestQuery = null;
this.requestRequest = null;
+ this.showPendingRequest = !!this.pushPending && config.showPendingRequest !== false;
};
/* Setup */
if ( Object.prototype.hasOwnProperty.call( this.requestCache, value ) ) {
deferred.resolve( this.requestCache[ value ] );
} else {
- if ( this.pushPending ) {
+ if ( this.showPendingRequest ) {
this.pushPending();
}
this.requestQuery = value;
// being aborted, or at least eventually. It would be nice if we could popPending()
// at abort time, but only if we knew that we hadn't already called popPending()
// for that request.
- if ( widget.popPending ) {
+ if ( widget.showPendingRequest ) {
widget.popPending();
}
} )