websemantics / Image-Select

Image Select is an extension of Chosen, a jQuery plugin that makes long, unwieldy select boxes much more user-friendly. It provides image support for Single and Multi select HTML tags.
http://websemantics.github.io/Image-Select
MIT License
148 stars 44 forks source link

Fix the case where no elements have been selected #18

Closed iamcal closed 8 years ago

iamcal commented 9 years ago

Suppose your code looks like this:

$('select.user-picker').chosen({});

If the selector matches no elements, then the chosen() function still gets run. The value for $this (not $(this)) never gets set, but then is used.