[Pkg-javascript-commits] [backbone] 28/281: Rename to undelegateEvents

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:01:53 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.9.0
in repository backbone.

commit ef40512d8441201e01f8d46c271fcf23235e9bc5
Author: Les Hill <leshill at gmail.com>
Date:   Mon Sep 19 10:30:45 2011 -0700

    Rename to undelegateEvents
    
    As suggested by @jashkenas https://github.com/documentcloud/backbone/pull/620#issuecomment-2132400
---
 backbone.js  | 4 ++--
 test/view.js | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/backbone.js b/backbone.js
index f5ade49..ebb0497 100644
--- a/backbone.js
+++ b/backbone.js
@@ -954,7 +954,7 @@
     delegateEvents : function(events) {
       if (!(events || (events = this.events))) return;
       if (_.isFunction(events)) events = events.call(this);
-      this.clearEvents();
+      this.undelegateEvents();
       for (var key in events) {
         var method = this[events[key]];
         if (!method) throw new Error('Event "' + events[key] + '" does not exist');
@@ -971,7 +971,7 @@
     },
 
     // Clears all callbacks previously bound to the view with `delegateEvents`.
-    clearEvents: function() {
+    undelegateEvents: function() {
       $(this.el).unbind('.delegateEvents' + this.cid);
     },
 
diff --git a/test/view.js b/test/view.js
index 88bc4b1..cdf98e5 100644
--- a/test/view.js
+++ b/test/view.js
@@ -56,7 +56,7 @@ $(document).ready(function() {
     equals(counter2, 3);
   });
 
-  test("View: clearEvents", function() {
+  test("View: undelegateEvents", function() {
     var counter = counter2 = 0;
     view.el = document.body;
     view.increment = function(){ counter++; };
@@ -67,7 +67,7 @@ $(document).ready(function() {
     $('#qunit-userAgent').trigger('click');
     equals(counter, 1);
     equals(counter2, 1);
-    view.clearEvents();
+    view.undelegateEvents();
     $('#qunit-userAgent').trigger('click');
     equals(counter, 1);
     equals(counter2, 2);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list