added unListenTo method

This commit is contained in:
Jono Brandel 2011-01-31 15:50:06 -08:00
parent 87f7f877c1
commit 6b61ad9b30

8
gui.js
View File

@ -217,7 +217,13 @@ var GUI = function() {
}; };
this.unlistenTo = function(controller) { 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) { this.listen = function(whoToListenTo) {