48ca4e77 by Chad Hietala

Check for window.addEventListener

1 parent 3e12fd20
...@@ -56,7 +56,13 @@ class Rivets.Binding ...@@ -56,7 +56,13 @@ class Rivets.Binding
56 @set Rivets.config.adapter.read @model, @keypath 56 @set Rivets.config.adapter.read @model, @keypath
57 57
58 if @type in bidirectionals 58 if @type in bidirectionals
59 @el.addEventListener 'change', @publish 59
60 #Check to see if addEventListener is available
61 if window.addEventListener
62 @el.addEventListener 'change', @publish
63 else
64 # Assume we are in IE and attach the event
65 @el.attatchEvent 'change', @publish
60 66
61 # Publishes the value currently set on the input element back to the model. 67 # Publishes the value currently set on the input element back to the model.
62 publish: (e) => 68 publish: (e) =>
......