dom-deprecated-debug.js revision 04b64da9f66b8791f4519ebf215ca4ee5771dfe3
12856N/AYUI.add('dom-deprecated', function(Y) {
12856N/A
12856N/A
12856N/AY.mix(Y.DOM, {
12856N/A // @deprecated
12856N/A children: function(node, tag) {
12856N/A var ret = [];
12856N/A if (node) {
12856N/A tag = tag || '*';
12856N/A ret = Y.Selector.query('> ' + tag, node);
12856N/A }
12856N/A return ret;
12856N/A },
14315N/A
12856N/A // @deprecated
14315N/A firstByTag: function(tag, root) {
14315N/A var ret;
12856N/A root = root || Y.config.doc;
14315N/A
14315N/A if (tag && root.getElementsByTagName) {
12856N/A ret = root.getElementsByTagName(tag)[0];
14315N/A }
14315N/A
14315N/A return ret || null;
14315N/A },
14315N/A
14315N/A /*
14315N/A * Finds the previous sibling of the element.
12856N/A * @method previous
14315N/A * @deprecated Use elementByAxis
14315N/A * @param {HTMLElement} element The html element.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current DOM node being tested as its only argument.
* If no function is given, the first sibling is returned.
* @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
* @return {HTMLElement | null} The matching DOM node or null if none found.
*/
previous: function(element, fn, all) {
return Y.DOM.elementByAxis(element, 'previousSibling', fn, all);
},
/*
* Finds the next sibling of the element.
* @method next
* @deprecated Use elementByAxis
* @param {HTMLElement} element The html element.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current DOM node being tested as its only argument.
* If no function is given, the first sibling is returned.
* @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
* @return {HTMLElement | null} The matching DOM node or null if none found.
*/
next: function(element, fn, all) {
return Y.DOM.elementByAxis(element, 'nextSibling', fn, all);
}
});
}, '@VERSION@' ,{requires:['dom-base']});