From ad505f843d0aef775b4bac5b842e051379f06c8b Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 10 Mar 2013 15:58:50 +0000 Subject: [PATCH] Script components returning data form proxied functions --- client/assets/dev/app.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/assets/dev/app.js b/client/assets/dev/app.js index ee1ff68..9187b5b 100644 --- a/client/assets/dev/app.js +++ b/client/assets/dev/app.js @@ -32,6 +32,7 @@ _kiwi.global = { } _.extend(this, Backbone.Events); + this._source = event_source; // Proxy the events to this dispatcher event_source.on('all', proxyEvent, this); @@ -40,6 +41,7 @@ _kiwi.global = { this.dispose = function () { event_source.off('all', proxyEvent); this.off(); + delete this.event_source; }; }, @@ -48,13 +50,14 @@ _kiwi.global = { var funcs = { kiwi: 'kiwi', raw: 'raw', kick: 'kick', topic: 'topic', part: 'part', join: 'join', action: 'action', ctcp: 'ctcp', - notice: 'notice', msg: 'privmsg' + notice: 'notice', msg: 'privmsg', + get: 'get' }; _.each(funcs, function(gateway_fn, func_name) { obj[func_name] = function() { var fn_name = gateway_fn; - _kiwi.gateway[fn_name].apply(_kiwi.gateway, arguments); + return _kiwi.gateway[fn_name].apply(_kiwi.gateway, arguments); }; }); @@ -68,7 +71,10 @@ _kiwi.global = { }; _.each(funcs, function(controlbox_fn, func_name) { - obj[func_name] = _kiwi.app.controlbox[controlbox_fn]; + obj[func_name] = function() { + var fn_name = controlbox_fn; + return _kiwi.app.controlbox[fn_name].apply(_kiwi.app.controlbox, arguments); + }; }); return obj; -- 2.25.1