jQsafi / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

Remove Function Errors under Persistence and First and only child node is removed #112

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Enable persistence
2. Expand node to view child node
3. Remove single child node that is expanded.

What version of the product are you using? .5
On what operating system and browser? xp ie7

Node is removed as expected, but persistence tries to re-expand node after 
all child nodes were removed.
Simply change...  approx line 719 error goes away.
This is obviously due to persistence trying to expand the child node that 
was selected to be removed.

        var fxDuration = opts.fx ? (opts.fx.duration || 200) : 0;
        for(var i=0; i<this.childList.length; i++ ) {
            var $child = $(this.childList[i].div);
            if( fxDuration ) {
                // This is a toggle, so only do it, if not 
already rendered (in)visible (issue 98)
                if( bExpand != $child.is(':visible') )
                    $child.animate(opts.fx, 
fxDuration);
            } else {
                if( bExpand )
                    $child.show();
                else
                    $child.hide(); // TODO: this seems 
to be slow, when called the first time for an element
            }
        }       

TO

        var fxDuration = opts.fx ? (opts.fx.duration || 200) : 0;
        if (this.childList)
            {
            for(var i=0; i<this.childList.length; i++ ) {
                var $child = $(this.childList[i].div);
                if( fxDuration ) {
                    // This is a toggle, so only do 
it, if not already rendered (in)visible (issue 98)
                    if( bExpand != $child.is
(':visible') )
                        $child.animate(opts.fx, 
fxDuration);
                } else {
                    if( bExpand )
                        $child.show();
                    else
                        $child.hide(); // TODO: 
this seems to be slow, when called the first time for an element
                }
            }
        }

Please provide any additional information below.

Original issue reported on code.google.com by cdwil...@gmail.com on 7 Aug 2009 at 8:56

GoogleCodeExporter commented 9 years ago
Thanks, this should be fixed in 0.5.1.
Can you confirm?

Original comment by moo...@wwwendt.de on 16 Aug 2009 at 8:04

GoogleCodeExporter commented 9 years ago
no feedback given; closing this as 'fixed'

Original comment by moo...@wwwendt.de on 3 Sep 2009 at 6:01

GoogleCodeExporter commented 9 years ago
considered verified

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:12