GitHub PullRequestReviewCommentEvent at 2014-03-13 07:03:06
Repository: backbone
Actor: wyuenho
Payload: {"comment":{"url":"https://api.github.com/repos/jashkenas/backbone/pulls/comments/10554450","id":10554450,"diff_hunk":"@@ -1105,25 +1122,43 @@\n \n         var match = key.match(delegateEventSplitter);\n         var eventName = match[1], selector = match[2];\n-        method = _.bind(method, this);\n-        eventName += '.delegateEvents' + this.cid;\n-        if (selector === '') {\n-          this.$el.on(eventName, method);\n-        } else {\n-          this.$el.on(eventName, selector, method);\n-        }\n+        this.delegate(eventName, selector, _.bind(method, this));\n       }\n       return this;\n     },\n \n-    // Clears all callbacks previously bound to the view with `delegateEvents`.\n+    // Add a single event listener to the element responding only to the\n+    // optional `selector` or catches all `eventName` events. Subclasses can\n+    // override this to utilize an alternative DOM event management API. Returns\n+    // the listener for easy undelegation with `undelegate`.\n+    delegate: function(eventName, selector, listener) {\n+      eventName += '.delegateEvents' + this.cid;\n+      // When `delegate` is called with two arguments, `selector` is actually\n+      // the `listener`\n+      var listener = _.isFunction(selector) ? selector : listener;\n+      if (selector === '') {\n+        this.$el.on(eventName, listener);\n+      } else {\n+        this.$el.on(eventName, selector, listener);\n+      }","path":"backbone.js","position":80,"original_position":80,"commit_id":"3850d37def7d4b9386d94f8708cab36985dbb308","original_commit_id":"3850d37def7d4b9386d94f8708cab36985dbb308","user":{"login":"wyuenho","id":160028,"avatar_url":"https://gravatar.com/avatar/8c68a839282f699145cb8bc314287555?d=https%3A%2F%2Fidenticons.github.com%2F9128f527533fa934adcd07f95cbadb3e.png&r=x","gravatar_id":"8c68a839282f699145cb8bc314287555","url":"https://api.github.com/users/wyuenho","html_url":"https://github.com/wyuenho","followers_url":"https://api.github.com/users/wyuenho/followers","following_url":"https://api.github.com/users/wyuenho/following{/other_user}","gists_url":"https://api.github.com/users/wyuenho/gists{/gist_id}","starred_url":"https://api.github.com/users/wyuenho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wyuenho/subscriptions","organizations_url":"https://api.github.com/users/wyuenho/orgs","repos_url":"https://api.github.com/users/wyuenho/repos","events_url":"https://api.github.com/users/wyuenho/events{/privacy}","received_events_url":"https://api.github.com/users/wyuenho/received_events","type":"User","site_admin":false},"body":"Yeah I'm not sure about this revert either. @akre54 ?","created_at":"2014-03-13T07:03:06Z","updated_at":"2014-03-13T07:03:06Z","html_url":"https://github.com/jashkenas/backbone/pull/3003#discussion_r10554450","pull_request_url":"https://api.github.com/repos/jashkenas/backbone/pulls/3003","_links":{"self":{"href":"https://api.github.com/repos/jashkenas/backbone/pulls/comments/10554450"},"html":{"href":"https://github.com/jashkenas/backbone/pull/3003#discussion_r10554450"},"pull_request":{"href":"https://api.github.com/repos/jashkenas/backbone/pulls/3003"}}}}