diff --git a/deluge/ui/web/js/deluge-all/Deluge.Events.js b/deluge/ui/web/js/deluge-all/Deluge.Events.js index 8cde2492b..f8d7490c6 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.Events.js +++ b/deluge/ui/web/js/deluge-all/Deluge.Events.js @@ -74,7 +74,7 @@ Copyright: 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(); }, diff --git a/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js b/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js index bd5001904..672fa5bff 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js +++ b/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js @@ -96,7 +96,7 @@ Ext.deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, { 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}, diff --git a/deluge/ui/web/js/deluge-all/Deluge.UI.js b/deluge/ui/web/js/deluge-all/Deluge.UI.js index 529924ed8..ac6c6aee9 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.UI.js +++ b/deluge/ui/web/js/deluge-all/Deluge.UI.js @@ -84,7 +84,7 @@ Deluge.UI = { Deluge.Login.show(); }, this, {single: true}); - this.update = this.update.bind(this); + this.update = this.update.createDelegate(this); }, update: function() { diff --git a/deluge/ui/web/js/deluge-all/Deluge.js b/deluge/ui/web/js/deluge-all/Deluge.js index a85d2eebc..ca431a7a1 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.js +++ b/deluge/ui/web/js/deluge-all/Deluge.js @@ -38,16 +38,6 @@ Ext.namespace('Ext.deluge'); 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('<', '<').replace('>', '>');