From c6aa3fff6c73d78e2a556209d5e9ca0b0e731c4f Mon Sep 17 00:00:00 2001 From: mike Date: Sat, 25 Jun 2016 14:36:28 -0400 Subject: [PATCH] update GUI.remove Remove controllers from __listening when removing them --- src/dat/gui/GUI.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dat/gui/GUI.js b/src/dat/gui/GUI.js index 6ce1eb5..c9830c2 100644 --- a/src/dat/gui/GUI.js +++ b/src/dat/gui/GUI.js @@ -545,9 +545,11 @@ define([ */ remove: function (controller) { - // TODO listening? this.__ul.removeChild(controller.__li); - this.__controllers.splice(this.__controllers.indexOf(controller), 1); + var ixl = this.__listening.indexOf(controller); + if (ixl > 0) + this.__listening.pop(ixl); + this.__controllers.pop(this.__controllers.indexOf(controller)); var _this = this; common.defer(function () { _this.onResize();