yanickrochon / jquery.uix.multiselect

Completely rewritten, multiselect widget with a more concise API
http://mind2soft.com/labs/jquery/multiselect/
MIT License
139 stars 62 forks source link

Creating an option for changing the search delay #82

Closed ksiegel closed 10 years ago

ksiegel commented 10 years ago

I'd like to create an option that allows the developer to specify the delay of the search if they'd like. For me, I feel 500ms is too slow. For some, it may be too fast. I prefer 200ms.

I propose doing this by modifying this._searchDelayed = new SearchDelayed(this, {delay: 500}); to this._searchDelayed = new SearchDelayed(this, {delay: that.searchDelay}); and adding a searchDelay: 500 // Time in MS to wait before performing a search to the options.

Opinions on naming or necessity of this option?

yanickrochon commented 10 years ago

Well, since this is already available in the SearchDelay object, and the delay option only used on line 575, I would remove the SearchDelay's options object altogether and reference directly this._widget.options.searchDelay. That options was from a very early draft and I thought I'd add more options to that component... apparently I was wrong :)

Then, simply adding a searchDelay option (which would default to 500) will resolve this issue. What do you think?