mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-01 10:46:26 +00:00
fa2b10a2e7
This way, src contains sources, and dist contains distribution files. Also, add some documentation about the folders in the README and an adr. Change-Id: Ie0b9f6475b8423b90e927633d883bde3cd5d5e4d
27 lines
487 B
JavaScript
27 lines
487 B
JavaScript
( function ( mw, $ ) {
|
|
|
|
/**
|
|
* Sugar around `window.setTimeout`.
|
|
*
|
|
* @example
|
|
* function continueProcessing() {
|
|
* // ...
|
|
* }
|
|
*
|
|
* mw.popups.wait( 150 ).then( continueProcessing );
|
|
*
|
|
* @param {Number} delay The number of milliseconds to wait
|
|
* @return {jQuery.Promise}
|
|
*/
|
|
module.exports = function ( delay ) {
|
|
var result = $.Deferred();
|
|
|
|
setTimeout( function () {
|
|
result.resolve();
|
|
}, delay );
|
|
|
|
return result.promise();
|
|
};
|
|
|
|
}( mediaWiki, jQuery ) );
|