mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-28 01:50:09 +00:00
Increase timout for browser cache hits from 10ms to 100ms
At the moment, the blur effect is shown all the time when flipping back and forth between images that have already been loaded. I believe the code just does not have enough time to get it's job done. Even if it was a cache hit, the very low limit of only 10ms results in all actions being considered "long running", and the blur effect been shown. Given the animation takes 300ms, using a very low threshold like 10ms seems unfair. Something like 1/2 of the animation time seems more appropriate. Change-Id: I8d655be3830fef3f363a0942ac64c932c1e8f7f7
This commit is contained in:
parent
8251aa89b7
commit
550d01d231
|
@ -447,8 +447,9 @@
|
|||
this.setImage( this.ui, thumbnail, imageElement, imageWidths );
|
||||
|
||||
// We only animate unblurWithAnimation if the image wasn't loaded from the cache
|
||||
// A load in < 10ms is considered to be a browser cache hit
|
||||
if ( this.blurredThumbnailShown && loadTime > 10 ) {
|
||||
// A load in < 100ms is fast enough (maybe even browser cache hit) that
|
||||
// using a 300ms animation would needlessly deter from a fast experience.
|
||||
if ( this.blurredThumbnailShown && loadTime > 100 ) {
|
||||
this.ui.canvas.unblurWithAnimation();
|
||||
} else {
|
||||
this.ui.canvas.unblur();
|
||||
|
|
Loading…
Reference in a new issue