4d2f8966 by Michael Richards

Add support for passing in jQuery objects to the Rivets.View constructor. [Closes #22]

1 parent db1c574d
...@@ -75,6 +75,9 @@ ...@@ -75,6 +75,9 @@
75 75
76 this.bindingRegExp = __bind(this.bindingRegExp, this); 76 this.bindingRegExp = __bind(this.bindingRegExp, this);
77 77
78 if (this.el.jquery) {
79 this.el = this.el.get(0);
80 }
78 this.build(); 81 this.build();
79 } 82 }
80 83
......
...@@ -52,6 +52,7 @@ class Rivets.View ...@@ -52,6 +52,7 @@ class Rivets.View
52 # The parent DOM element and the model objects for binding are passed into the 52 # The parent DOM element and the model objects for binding are passed into the
53 # constructor. 53 # constructor.
54 constructor: (@el, @models) -> 54 constructor: (@el, @models) ->
55 @el = @el.get(0) if @el.jquery
55 @build() 56 @build()
56 57
57 # Regular expression used to match binding attributes. 58 # Regular expression used to match binding attributes.
......