mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-12-18 08:40:49 +00:00
Hygiene: revise lazyImageLoader.loadImages() API
There is no longer a need to pass in a jQuery dependency. Don't use the stateful skin to query image placeholders. Use the lazy image loader instead. Depends-On: I3d023b3d96bf278666abb956142e5cee12b68b1f Bug: T214658 Change-Id: I2bf42366c0e27462c32162124d07761b91d66166
This commit is contained in:
parent
6627078c08
commit
0ce4fa8a66
|
@ -96,9 +96,8 @@
|
||||||
// If all image downloads are taking longer to load then the MAX_PRINT_TIMEOUT
|
// If all image downloads are taking longer to load then the MAX_PRINT_TIMEOUT
|
||||||
// abort the spinner and print regardless.
|
// abort the spinner and print regardless.
|
||||||
icon.timeout = setTimeout( doPrint, MAX_PRINT_TIMEOUT );
|
icon.timeout = setTimeout( doPrint, MAX_PRINT_TIMEOUT );
|
||||||
lazyImageLoader.loadImages(
|
lazyImageLoader.loadImages( lazyImageLoader.queryPlaceholders( document.getElementById( 'content' ) ) )
|
||||||
skin.$.bind( skin ), skin.getUnloadedImages()
|
.then( doPrintBeforeTimeout, doPrintBeforeTimeout );
|
||||||
).then( doPrintBeforeTimeout, doPrintBeforeTimeout );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
spy = this.sandbox.stub( window, 'print' );
|
spy = this.sandbox.stub( window, 'print' );
|
||||||
|
|
||||||
this.sandbox.stub( lazyImageLoader, 'loadImages' ).returns( d.resolve() );
|
this.sandbox.stub( lazyImageLoader, 'loadImages' ).returns( d.resolve() );
|
||||||
|
this.sandbox.stub( lazyImageLoader, 'queryPlaceholders' ).returns( [] );
|
||||||
|
|
||||||
handler();
|
handler();
|
||||||
d.then( function () {
|
d.then( function () {
|
||||||
|
@ -49,6 +50,7 @@
|
||||||
spy = this.sandbox.stub( window, 'print' );
|
spy = this.sandbox.stub( window, 'print' );
|
||||||
|
|
||||||
this.sandbox.stub( lazyImageLoader, 'loadImages' ).returns( d );
|
this.sandbox.stub( lazyImageLoader, 'loadImages' ).returns( d );
|
||||||
|
this.sandbox.stub( lazyImageLoader, 'queryPlaceholders' ).returns( [] );
|
||||||
|
|
||||||
window.setTimeout( function () {
|
window.setTimeout( function () {
|
||||||
d.resolve();
|
d.resolve();
|
||||||
|
@ -69,6 +71,7 @@
|
||||||
spy = this.sandbox.stub( window, 'print' );
|
spy = this.sandbox.stub( window, 'print' );
|
||||||
|
|
||||||
this.sandbox.stub( lazyImageLoader, 'loadImages' ).returns( d );
|
this.sandbox.stub( lazyImageLoader, 'loadImages' ).returns( d );
|
||||||
|
this.sandbox.stub( lazyImageLoader, 'queryPlaceholders' ).returns( [] );
|
||||||
|
|
||||||
window.setTimeout( function () {
|
window.setTimeout( function () {
|
||||||
d.resolve();
|
d.resolve();
|
||||||
|
|
Loading…
Reference in a new issue