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 @@
this.bindingRegExp = __bind(this.bindingRegExp, this);
if (this.el.jquery) {
this.el = this.el.get(0);
}
this.build();
}
......
......@@ -52,6 +52,7 @@ class Rivets.View
# The parent DOM element and the model objects for binding are passed into the
# constructor.
constructor: (@el, @models) ->
@el = @el.get(0) if @el.jquery
@build()
# Regular expression used to match binding attributes.
......