Permalink
Browse files

Merge pull request #52 from michaelperrin/bugfix/jquery-1.9

Fix compatibility with jQuery 1.9.x
  • Loading branch information...
2 parents de37a51 + c2948d0 commit cd9751443aefd3a2c074a4ebade3a1d5a1fe7004 @meltingice committed Feb 7, 2013
Showing with 12 additions and 12 deletions.
  1. +4 −4 lib/ajax-chosen.js
  2. +3 −3 lib/ajax-chosen.min.js
  3. +5 −5 src/ajax-chosen.coffee
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -31,8 +31,8 @@ do ($ = jQuery) ->
# into the input form that chosen has created
# Retrieve the current value of the input form
- untrimmed_val = $(@).attr('value')
- val = $.trim $(@).attr('value')
+ untrimmed_val = $(@).val()
+ val = $.trim $(@).val()
# Depending on how much text the user has typed, let them know
# if they need to keep typing or if we are looking for their data
@@ -139,16 +139,16 @@ do ($ = jQuery) ->
else
# If there are no results, display the no_results text
select.data().chosen.no_results_clear()
- select.data().chosen.no_results field.attr('value')
-
+ select.data().chosen.no_results field.val()
+
# Finally, call the user supplied callback (if it exists)
success(data) if success?
# For some reason, the contents of the input field get removed once you
# call trigger above. Often, this can be very annoying (and can make some
# searches impossible), so we add the value the user was typing back into
# the input field.
- field.attr('value', untrimmed_val)
+ field.val(untrimmed_val)
# Because non-ajax Chosen isn't constantly re-building results, when it
# DOES rebuild results (during liszt:updated above, it clears the input

0 comments on commit cd97514

Please sign in to comment.