From b1631b0327a4c2ec08d22e1673eb08704e8b4bfb Mon Sep 17 00:00:00 2001 From: Jono Brandel Date: Mon, 31 Jan 2011 15:50:06 -0800 Subject: [PATCH] added unListenTo method --- gui.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gui.js b/gui.js index 842638a..3d9be28 100644 --- a/gui.js +++ b/gui.js @@ -217,7 +217,13 @@ var GUI = function() { }; this.unlistenTo = function(controller) { - // TODO + // TODO: test this + for(var i = 0; i < listening.length; i++) { + if(listening[i] == controller) listening.splice(i, 1); + } + if(listening.length <= 0) { + clearInterval(listenInterval); + } }; this.listen = function(whoToListenTo) {