Permalink
Browse files

Fix compatibility with jQuery 1.9.x

  • Loading branch information...
1 parent de37a51 commit c2948d0addfd8d3c8bad22e7de4ddf09ea00f4e0 @michaelperrin michaelperrin committed Jan 24, 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 c2948d0

Please sign in to comment.