project-ufa / jpicker

jPicker is a fast, lightweight color picker jQuery plugin.
0 stars 0 forks source link

container not removed at destroy #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.call the destroy method after creating a jPicker

What is the expected output? What do you see instead?
The container is emptied, but the containing div still is there

What version of the product are you using? On what operating system?
Version 1.1.6

Please provide any additional information below.

If you add container.remove() after container.empty() in the destroy method 
things will be ok.
You can even skip the empty part.

Original issue reported on code.google.com by arnold.s...@gmail.com on 4 Nov 2011 at 10:48

GoogleCodeExporter commented 9 years ago
I replaced container.html('') with container.remove, and the next call (on the 
next existing picker on the list) caused an error "TypeError: an is null", so, 
the fix is not as easy. Or I'm not looking at the right place?

Original comment by eye...@gmail.com on 31 Aug 2012 at 2:01

GoogleCodeExporter commented 9 years ago
I changed the code to this in jPicker 1.1.6:
    commitCallback = null;
    cancelCallback = null;
    liveCallback = null;
    //container.empty();
   container.remove(); // ASC added to remove the empty container too
   for (i = 0; i < List.length; i++) if (List[i] == $this) List.splice(i, 1);

Original comment by arnold.s...@gmail.com on 31 Aug 2012 at 2:07