Skip to content

Commit

Permalink
Return the jquery object for el when this.$ is called without argument
Browse files Browse the repository at this point in the history
  • Loading branch information
TMaYaD committed Nov 23, 2011
1 parent 1332246 commit 2d2198c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,11 @@
// This should be prefered to global lookups, if you're dealing with
// a specific view.
var selectorDelegate = function(selector) {
return $(selector, this.el);
if (typeof selector == 'undefined') {
return $(this.el);
} else {
return $(selector, this.el);
};
};

// Cached regex to split keys for `delegate`.
Expand Down

0 comments on commit 2d2198c

Please sign in to comment.