Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#837 closed bug (fixed)

DOM inconsistency in add(),maybe more places

Reported by: sa.cesare@… Owned by:
Priority: major Milestone: 1.1
Component: core Version: 1.1
Keywords: Cc:
Blocked by: Blocking:

Description

1.0.4 version has support for direct manipulation on DOM elements,something like:

$("li.hl",p).add(el).each()

where "el" is simply DOM element,now in 1.1 I need to wrap it to $(),as:

$("li.hl",p).add( $(el) ).each()

otherwise construction dosen't work at all.

Change History (2)

comment:1 Changed 13 years ago by sa.cesare@…

OK,I found bug,1.04: add: function(t) {

return this.pushStack( jQuery.merge( this,

typeof t == "string" ? jQuery.find(t) : t.constructor == Array ? t : [t] ), arguments );

}; in 1.1 reduced to: add: ... typeof t == "string" ? jQuery(t).get() : t ...

so,it always assume "t" is "Array",that contradictonary to docs,which promote array/element/sequence(of elements) interchangeability. IMHO,it must exists generic conversion "toArray" method,used across framework everywhere,if you will,but it seems every method has it's own parameter parsing logic.

comment:2 Changed 13 years ago by john

Resolution: fixed
Status: newclosed

Fixed in SVN rev 1137.

Note: See TracTickets for help on using tickets.