jannbmsy / dynatree

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

removeChild function #402

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Fix for issue 399 cause all sibling nodes to be removed when a node is removed.
Problem Code:
jquery.dynatree.js line 1436 in removeChild function:

if(this.ul){
    $('li',$(this.ul)).remove()};
}

Solution:

if(this.ul){
    this.ul.removeChild(tn.li);
}

Rationale, the solution for the original issue was wrapping the removeChild 
statement in an if statement in the event that this.ul is null.

 - Dynatree v1.2.3 
 - jQuery 1.8.0
 - Firefox 18.0
----------------------------------------------------------------------
Original Issue:
1.Removing a node with multiple siblings

I occasionally receive uncaught exception: [Exception... "Component returned 
failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) 
[nsIDOMHTMLUListElement.removeChild]"  nsresult: "0x80004003 
(NS_ERROR_INVALID_POINTER)" 

Problem Code:
jquery.dynatree.js line 1380 in removeChild function:

    this.ul.removeChild(tn.li);

Replace with (per the 231 issue fix in removeChildren function):

if(this.ul){
    $('li',$(this.ul)).remove()}
}
 - Dynatree v1.2.0 (minimized version)
 - jQuery 1.8.0
 - Firefox 18.0

Original issue reported on code.google.com by Eboqu...@gmail.com on 11 Feb 2013 at 7:58

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 12 Feb 2013 at 12:05

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r643.

Original comment by moo...@wwwendt.de on 12 Feb 2013 at 12:11

GoogleCodeExporter commented 8 years ago
@Eboquist: could you please verify?

Original comment by moo...@wwwendt.de on 12 Feb 2013 at 12:12

GoogleCodeExporter commented 8 years ago
Confirmed. This fix solves issues 399 and 402.

Original comment by Eboqu...@gmail.com on 12 Feb 2013 at 1:20