Check for window.addEventListener
Showing
1 changed file
with
7 additions
and
1 deletions
... | @@ -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) => | ... | ... |
-
Please register or sign in to post a comment