rvera / image-picker

Image Picker is a simple jQuery plugin that transforms a select element into a more user friendly graphical interface.
http://rvera.github.com/image-picker
Other
907 stars 216 forks source link

Add an option *time_interval* in constructor #73

Closed nalysius closed 7 years ago

nalysius commented 8 years ago

In a personal project I would use image-picker with lot of picture, so much that my Web browser frozen every time. The browser tried to load too much pictures at the same time.

This commit adds an option in the constructor, named _timeinterval (set to 0 by default), that set a timer between loading of two pictures. Thanks to that, I can load lot of pictures without any problem. Note that .coffee file is not updated !

To test it, just create a little HTML file and put lot of pictures, they will load progressively.

rvera commented 7 years ago

Thanks for making a PR for this issue. This could also be done in the initialized callback, given that and since I'd like to keep this as lightweight as possible and I won't merge this, but this is a good way to solve this!