233c0024 by Nicklas Ansman Giertz

Allow binding to the root element

1 parent 96223e87
...@@ -61,8 +61,10 @@ class Rivets.View ...@@ -61,8 +61,10 @@ class Rivets.View
61 build: => 61 build: =>
62 @bindings = [] 62 @bindings = []
63 bindingRegExp = @bindingRegExp() 63 bindingRegExp = @bindingRegExp()
64 elements = [@el]
65 elements.concat Array::slice.call @el.getElementsByTagName '*'
64 66
65 for node in @el.getElementsByTagName '*' 67 for node in elements
66 for attribute in node.attributes 68 for attribute in node.attributes
67 if bindingRegExp.test attribute.name 69 if bindingRegExp.test attribute.name
68 type = attribute.name.replace bindingRegExp, '' 70 type = attribute.name.replace bindingRegExp, ''
......