-
Notifications
You must be signed in to change notification settings - Fork 46
Conversation
What functionality are you missing from |
Hi, I miss the chainability from push and using Example:
regards, |
|
Why not having a new |
Great idea. Could you please add specs and make sure the code style matches the rest of the project ( |
Maybe you can help me, it's my first time with mocha. When I run |
The problem is only for |
src/selector/extra.js
Outdated
export const concat = function( elements ) { | ||
const nodes = this; | ||
each( elements, element => { | ||
if( nodes.indexOf( element ) === -1 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The jquery-compat mode has an index
method (not indexOf
), like jQuery itself; so you can't use this directly. Perhaps something like [].indexOf.call(this, element)
is better here.
src/selector/extra.js
Outdated
nodes.push( element ); | ||
} | ||
} ); | ||
return $( nodes ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please return this
; no need to create a new instance?
Thanks for your help. |
Can I add the following code at the beginning of the method and still compliant with DOMtastic's philosophy:
to be able to concat from a selector ? |
Add new nodes based on a selector to an existing instance.
Example:
$( '#div1' ).add( '#div2' )