compact / angular-bootstrap-lightbox

An AngularJS lightbox built using UI Bootstrap Modal.
http://compact.github.io/angular-bootstrap-lightbox/
MIT License
306 stars 134 forks source link

Set a flag on loading images to be used for showing a loading-state animation element #28

Closed jagged3dge closed 9 years ago

jagged3dge commented 9 years ago

Thank you for this excellent module!

Would it make sense to expose a flag for each image that is being loaded via the ImageLoader service, for e.g. image.isLoaded. It could be set to true after the ImageLoader promise is resolved in the Lightbox.setImage method. It would help in toggling an animation element to let the user know that images are being loaded in the background.

I am using another sweet module for showing progress of global $http/$resource promises (angular-loading-bar), but I believe it'd be even better UX if a different loading indicator appears in the center of the space where the loaded image would show up.

Does this make sense? Or is it possible to achieve that with custom templates as it is that I couldn't figure out?

compact commented 9 years ago

I added a property to the service, Lightbox.loading, that is true when an image is loading and false otherwise. Hope this is helpful for binding an animation.

jagged3dge commented 9 years ago

Oh yes. Thanks for adding this! Sorry for responding so late