Closed dvakor closed 9 years ago
Can you link to your fork, @ArchLord42RU? I ran into the same issue as well. Maybe we can figure out something together :)
I found the main trouble: it is a trying to load empty image. I'm fixed it and its work fine now :)
Jay, that worked. Spotted a bug while applying your patch :)
I have the same bug. This bug occurs when the image have already been loaded once. They are cached by the browser and the promise resolves instantly. The propose solution by @ArchLord42RU resolves this issue. It would be great to merge it. Thank you
Same situation here. I lost some time before finding this solution. It works great, @ArchLord42RU ! +1 for merging it
@compact Can this fix be merged please, if it's satisfactory? I'm having the same issue reported by others.
Fixed, please check v0.12.0.
Sorry for the wait.
When i'm opening lightbox by clicking on any image on my page and image loaded and after this image's height\width becomes 0px. I'm try to debug this and found reason of that behavior: ImageLoader.load(src) promise generate both event success and failure... In the Chrome failure fire before success and we see no problems, but in FF success fire before failure and it resize to 0px.
OK, i'm deep more in this function and found intresting thing,
scope.$watch(function () { return attrs.lightboxSrc; }
fires two times,
1st time with attrs.lightboxSrc == "" and Lightbox.index == -1 2st time with attrs.lightboxSrc == %MyUrl% and Lightbox.index == %MyIndex%
I'm fix this by this code
if(Lightbox.index < 0){ return }
before
ImageLoader.load(src).then(function (image) {})
But i dont wanna to pull request cause i dont know how correct my code >.<
Sorry for my English, its not my native :)