Merge pull request #897 from dcneiner/jquery-zepto-context

Made minor optimization to scoped jQuery/Zepto method $ on the Backbone.View
This commit is contained in:
Jeremy Ashkenas
2012-01-30 06:30:27 -08:00

View File

@@ -984,7 +984,7 @@
// jQuery delegate for element lookup, scoped to DOM elements within the
// current view. This should be prefered to global lookups where possible.
$: function(selector) {
return $(selector, this.el);
return this.$el.find(selector);
},
// Initialize is an empty function by default. Override it with your own