fd434ad2 by Michael Richards

Use jQuery's .val(…) in the value binder's routine function if window.jQuery is …

…present. [Closes #133]
1 parent 790f145e
...@@ -313,6 +313,12 @@ Rivets.binders = ...@@ -313,6 +313,12 @@ Rivets.binders =
313 unbind: (el) -> 313 unbind: (el) ->
314 unbindEvent el, 'change', @currentListener 314 unbindEvent el, 'change', @currentListener
315 routine: (el, value) -> 315 routine: (el, value) ->
316 if window.jQuery?
317 el = jQuery el
318
319 if value?.toString() isnt el.val()?.toString()
320 el.val if value? then value else ''
321 else
316 if el.type is 'select-multiple' 322 if el.type is 'select-multiple'
317 o.selected = o.value in value for o in el if value? 323 o.selected = o.value in value for o in el if value?
318 else if value?.toString() isnt el.value?.toString() 324 else if value?.toString() isnt el.value?.toString()
......