]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - jssource/src_files/include/javascript/yui3/build/dom/dom-deprecated.js
Release 6.5.0
[Github/sugarcrm.git] / jssource / src_files / include / javascript / yui3 / build / dom / dom-deprecated.js
1 /*
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
5 version: 3.3.0
6 build: 3167
7 */
8 YUI.add('dom-deprecated', function(Y) {
9
10
11 Y.mix(Y.DOM, {
12     // @deprecated
13     children: function(node, tag) {
14         var ret = [];
15         if (node) {
16             tag = tag || '*';
17             ret = Y.Selector.query('> ' + tag, node); 
18         }
19         return ret;
20     },
21
22     // @deprecated
23     firstByTag: function(tag, root) {
24         var ret;
25         root = root || Y.config.doc;
26
27         if (tag && root.getElementsByTagName) {
28             ret = root.getElementsByTagName(tag)[0];
29         }
30
31         return ret || null;
32     },
33
34     /*
35      * Finds the previous sibling of the element.
36      * @method previous
37      * @deprecated Use elementByAxis
38      * @param {HTMLElement} element The html element.
39      * @param {Function} fn optional An optional boolean test to apply.
40      * The optional function is passed the current DOM node being tested as its only argument.
41      * If no function is given, the first sibling is returned.
42      * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
43      * @return {HTMLElement | null} The matching DOM node or null if none found. 
44      */
45     previous: function(element, fn, all) {
46         return Y.DOM.elementByAxis(element, 'previousSibling', fn, all);
47     },
48
49     /*
50      * Finds the next sibling of the element.
51      * @method next
52      * @deprecated Use elementByAxis
53      * @param {HTMLElement} element The html element.
54      * @param {Function} fn optional An optional boolean test to apply.
55      * The optional function is passed the current DOM node being tested as its only argument.
56      * If no function is given, the first sibling is returned.
57      * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
58      * @return {HTMLElement | null} The matching DOM node or null if none found. 
59      */
60     next: function(element, fn, all) {
61         return Y.DOM.elementByAxis(element, 'nextSibling', fn, all);
62     }
63
64 });
65
66
67
68 }, '3.3.0' ,{requires:['dom-base']});