Allow binding to the root element
Showing
1 changed file
with
3 additions
and
1 deletions
... | @@ -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, '' | ... | ... |
-
Please register or sign in to post a comment