nodelist.js revision 6ea48d96f5a25dc7cb072787412ae2d88fc34f32
/**
* The NodeList Utility provides a DOM-like interface for interacting with DOM nodes.
* @module node
* @submodule node-list
*/
/**
* The NodeList class provides a wrapper for manipulating DOM NodeLists.
* Use Y.get() to retrieve NodeList instances.
*
* <strong>NOTE:</strong> NodeList properties are accessed using
* the <code>set</code> and <code>get</code> methods.
*
* @class NodeList
* @constructor
*/
Y.Array._diff = function(a, b) {
var removed = [],
present = false;
present = false;
if (a[i] === b[j]) {
present = true;
continue outer;
}
}
if (!present) {
}
}
return removed;
};
Y.Array.diff = function(a, b) {
return {
};
};
// "globals"
var g_nodelists = [],
UID = '_yuid',
if (typeof nodes === 'string') {
}
Y.stamp(this);
};
// end "globals"
style: {
value: {}
}
};
NodeList._instances = [];
} else {
}
};
// call with instance context
// TODO: use node.set if instance exists
if (!instance) {
}
});
};
// call with instance context
ret = [];
// TODO: use node.get if instance exists
if (!instance) { // reuse tmp instance
}
});
return ret;
};
initializer: function(config) {
},
/**
* Retrieves the Node instance at the given index.
* @method item
*
* @param {Number} index The index of the target Node.
* @return {Node} The Node instance at the given index.
*/
},
/**
* Applies the given function to each Node in the NodeList.
* @method each
* @param {Function} fn The function to apply
* @param {Object} context optional An optional context to apply the function with
* Default context is the NodeList instance
* @return {NodeList} NodeList containing the updated collection
* @chainable
*/
var instance = this;
});
},
/**
* Filters the NodeList instance down to only nodes matching the given selector.
* @method filter
* @param {String} selector The selector to filter against
* @return {NodeList} NodeList containing the updated collection
* @see Selector
*/
},
}
},
}
},
ret;
}
},
destructor: function() {
g_nodelists[this[UID]] = [];
},
refresh: function() {
var doc,
diff,
if (this._query) {
if (g_nodelists[this[UID]] &&
}
}
},
/**
* Returns the current number of items in the NodeList.
* @method size
* @return {Int} The number of items in the NodeList.
*/
size: function() {
},
toString: function() {
var str = '',
}
}
}
}
},
getter: function() {
},
}
});
}
}, true);
});
// zero-length result returns null
};