c102b078 by Michael Richards

Merge branch 'multiple-select-support'

2 parents f6c70967 20c0b4b7
......@@ -240,6 +240,7 @@ unbindEvent = (el, event, fn) ->
getInputValue = (el) ->
switch el.type
when 'checkbox' then el.checked
when 'select-multiple' then o.value for o in el when o.selected
else el.value
# Returns an event binding routine for the specified event.
......@@ -311,6 +312,9 @@ Rivets.routines =
html: (el, value) ->
el.innerHTML = if value? then value else ''
value: (el, value) ->
if el.type is 'select-multiple'
o.selected = o.value in value for o in el if value?
else
el.value = if value? then value else ''
text: (el, value) ->
if el.innerText?
......