Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added ability to avoid an additional '$()' call in 'setElement' metho…

…d if current 'element' is already wrapped with '$()'
  • Loading branch information...
commit 0d1d278c7ba99eb546ae35e261dd9c2fc99f941c 1 parent a960794
@mdreizin mdreizin authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  backbone.js
View
2  backbone.js
@@ -1131,7 +1131,7 @@
// Change the view's element (`this.el` property), including event
// re-delegation.
setElement: function(element, delegate) {
- this.$el = $(element);
+ this.$el = (element instanceof $) ? element : $(element);
this.el = this.$el[0];
if (delegate !== false) this.delegateEvents();
return this;
Please sign in to comment.
Something went wrong with that request. Please try again.