Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error trying to remove a controller #57

Open
GoogleCodeExporter opened this issue Oct 30, 2015 · 0 comments
Open

error trying to remove a controller #57

GoogleCodeExporter opened this issue Oct 30, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. remove one controller
2. add another controller
3. try to remove another controller

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
dat.gui 0.5.0

Please provide any additional information below.
The error is in the line 2032 in the source code of 0.5.0 version at remove 
function.

simply change:
this.__controllers.slice(this.__controllers.indexOf(controller), 1);
by
this.__controllers.splice(this.__controllers.indexOf(controller), 1);

I suggest also to add the next function

removeByProperty:function(propertyName)
      {
        var max=this.__controllers.length;
        var ind=-1;
        for (var n=0;n<max;n++)
        {
          if (this.__controllers[n].property==propertyName)
          {
            ind=n;
            break;
          }
        }
        if(ind>-1)
        {
          this.remove(this.__controllers[ind]);
        }
      },

Kind regards.

Original issue reported on code.google.com by [email protected] on 30 Dec 2014 at 2:39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant