0
|
1 //>>excludeStart("exclude", pragmas.exclude);
|
|
2 define([ "shoestring" ], function(){
|
|
3 //>>excludeEnd("exclude");
|
|
4
|
|
5 /**
|
|
6 * Returns the raw DOM node at the passed index.
|
|
7 *
|
|
8 * @param {integer} index The index of the element to wrap and return.
|
|
9 * @return {HTMLElement|undefined|array}
|
|
10 * @this shoestring
|
|
11 */
|
|
12 shoestring.fn.get = function( index ){
|
|
13
|
|
14 // return an array of elements if index is undefined
|
|
15 if( index === undefined ){
|
|
16 var elements = [];
|
|
17
|
|
18 for( var i = 0; i < this.length; i++ ){
|
|
19 elements.push( this[ i ] );
|
|
20 }
|
|
21
|
|
22 return elements;
|
|
23 } else {
|
|
24 return this[ index ];
|
|
25 }
|
|
26 };
|
|
27
|
|
28 //>>excludeStart("exclude", pragmas.exclude);
|
|
29 });
|
|
30 //>>excludeEnd("exclude");
|