-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Is your feature request related to a problem? Please describe.
When I request an image that does not exist, wait a moment, the little break icon will visible in the left corner, but the loading is still in the center.
Describe the solution you'd like
I think in the case, it maybe better to stop the loading and show a break icon in the center. (There is also loading in the viewer-navbar)
Describe alternatives you've considered
None.
Additional context
None.
Some ways
// method.js
// Make the image visible if it fails to load within 1s
this.timeout = setTimeout(() => {
removeClass(image, CLASS_INVISIBLE);
// here are the new code, remove the loading too
if (this.options.loading) {
removeClass(this.canvas, CLASS_LOADING);
}
// can remove the icon to the center
image.style.cssText = (
'height:0;'
+ `margin-left:${this.viewerData.width / 2}px;`
+ `margin-top:${this.viewerData.height / 2}px;`
+ 'max-width:none!important;'
+ 'position:relative;'
+ 'width:0;'
);
this.timeout = false;
}, 1000);
Thanks!
Metadata
Metadata
Assignees
Labels
No labels