From 2d2198c354a6fb137ac5fb5799a6fdd474792274 Mon Sep 17 00:00:00 2001 From: TMaYaD Date: Thu, 24 Nov 2011 02:38:08 +0530 Subject: [PATCH] Return the jquery object for el when this.$ is called without argument --- backbone.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backbone.js b/backbone.js index ade9db6f..2c0774ab 100644 --- a/backbone.js +++ b/backbone.js @@ -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`.