Fix the rest of the enyo.Ajax instances to use new bind style
authorChip Black <bytex64@bytex64.net>
Sun, 17 Nov 2013 23:27:55 +0000 (15:27 -0800)
committerChip Black <bytex64@bytex64.net>
Sun, 17 Nov 2013 23:27:55 +0000 (15:27 -0800)
www/jssrc/blerg/API.js

index 986ac09..cd85745 100644 (file)
@@ -128,7 +128,7 @@ enyo.kind({
         var req = new enyo.Ajax({
             url: url
         });
-        req.response(function(inSender, inResponse) {
+        req.response(this, function(inSender, inResponse) {
             this.bubble('onItemsLoaded', {
                 type: 'user',
                 username: username,
@@ -136,13 +136,13 @@ enyo.kind({
                 to: to,
                 entries: inResponse
             });
-        }.bind(this));
-        req.error(function(inSender, inResponse) {
+        });
+        req.error(this, function(inSender, inResponse) {
             if (inResponse == 404)
                 this.bubble('onUserNotFound');
             else
                 this.bubble('onAPIError', {response: inResponse});
-        }.bind(this));
+        });
         req.go();
     },
     loadTagRecords: function(type, tag) {