Opened 10 years ago

Closed 10 years ago

#9649 closed defect (fixed)

Nodelist appendTo/prependTo - wrong return value

Reported by: Les Owned by: James Burke
Priority: high Milestone: 1.4
Component: General Version: 1.3.2
Keywords: NodeList Cc:
Blocked By: Blocking:

Description

http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/tests/NodeList-manipulate.html

Evaluate in Firebug:

dojo.query(".foo").prependTo('#t')

Dojo should return all (8) inserted elements (as in jQuery), but an array of length 1 is returned.

Also, please write inline documentation for the return value of the appendTo() and prependTo() method.

Change History (4)

comment:1 Changed 10 years ago by Les

insertAfter() and insertBefore() should also return the inserted elements. Currently, only the first element is returned e.g.:

dojo.query(".foo").insertAfter('#t')

comment:2 Changed 10 years ago by James Burke

Milestone: tbd1.4
Owner: changed from anonymous to James Burke

Oops, yeah a silly bug. I should have a fix soon, thanks for the catch.

As for the documentation, the inline docs for each of the mentioned methods talks about the nodes in the current node list are returned and not the queries nodes, in the "description" area of the inline docs. Is the wording just bad or where you expecting that kind of text somewhere else in the inline docs?

comment:3 Changed 10 years ago by Les

Some functions describe the returned value in the "returns" area, but in many places the returned value is described in the function description. The documentation would be more consistent if the "returns" area was added for all functions that return a value.

comment:4 Changed 10 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [19534]) Fixes #9649, prependTo/appendTo returning wrong values. Also added returns: comments for all -manipulate and -traverse methods. Fixed an issue with latest firebug throwing off the -manipulate and -traverse tests.

Note: See TracTickets for help on using tickets.