Author: damoxc

Revision: 6152

Log:
        use createDelegate rather than bind, saving implementing our own method 
of setting a functions scope

Diff:
Modified: trunk/deluge/ui/web/js/deluge-all/Deluge.Events.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-all/Deluge.Events.js  2010-01-26 17:26:53 UTC 
(rev 6151)
+++ trunk/deluge/ui/web/js/deluge-all/Deluge.Events.js  2010-01-26 17:31:32 UTC 
(rev 6152)
@@ -74,7 +74,7 @@
                        Ext.each(this.toRegister, function(eventName) {
                                
Deluge.Client.web.register_event_listener(eventName);
                        });
-                       this.poll = this.poll.bind(this);
+                       this.poll = this.poll.createDelegate(this);
                        this.running = setInterval(this.poll, 2000);
                        this.poll();
                },

Modified: trunk/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js       2010-01-26 
17:26:53 UTC (rev 6151)
+++ trunk/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js       2010-01-26 
17:31:32 UTC (rev 6152)
@@ -96,7 +96,7 @@
                                var str = (config.value.formatter) ? 
config.value.formatter(config.value.value) : config.value.value;
                        }
                        item.setText(str);
-               }.bind(this);
+               }.createDelegate(this);
                
                updateStat('connections', {
                        value: {value: stats.num_connections},

Modified: trunk/deluge/ui/web/js/deluge-all/Deluge.UI.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-all/Deluge.UI.js      2010-01-26 17:26:53 UTC 
(rev 6151)
+++ trunk/deluge/ui/web/js/deluge-all/Deluge.UI.js      2010-01-26 17:31:32 UTC 
(rev 6152)
@@ -84,7 +84,7 @@
                        Deluge.Login.show();
                }, this, {single: true});
        
-               this.update = this.update.bind(this);
+               this.update = this.update.createDelegate(this);
        },
 
        update: function() {

Modified: trunk/deluge/ui/web/js/deluge-all/Deluge.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-all/Deluge.js 2010-01-26 17:26:53 UTC (rev 
6151)
+++ trunk/deluge/ui/web/js/deluge-all/Deluge.js 2010-01-26 17:31:32 UTC (rev 
6152)
@@ -38,16 +38,6 @@
 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
 
 (function() {
-    /* Add some helper functions to Ext */
-    Ext.apply(Function.prototype, {
-               bind: function(scope) {
-                       var self = this;
-                       return function() {
-                               return self.apply(scope, arguments);
-                       }
-               }
-    });
-    
     Ext.apply(Ext, {
                escapeHTML: function(text) {
                        text = String(text).replace('<', '&lt;').replace('>', 
'&gt;');


-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to