Skip to content

error trying to remove a controller #57

@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions