0
|
1 //>>excludeStart("exclude", pragmas.exclude);
|
|
2 define([ "shoestring", "dom/prev" ], function(){
|
|
3 //>>excludeEnd("exclude");
|
|
4
|
|
5 /**
|
|
6 * Returns a `shoestring` object with the set of *all* siblings before each element in the original set.
|
|
7 *
|
|
8 * @return shoestring
|
|
9 * @this shoestring
|
|
10 */
|
|
11 shoestring.fn.prevAll = function(){
|
|
12 //>>includeStart("development", pragmas.development);
|
|
13 if( arguments.length > 0 ){
|
|
14 shoestring.error( 'prevall-selector' );
|
|
15 }
|
|
16 //>>includeEnd("development");
|
|
17
|
|
18 var result = [];
|
|
19
|
|
20 this.each(function() {
|
|
21 var $previous = shoestring( this ).prev();
|
|
22
|
|
23 while( $previous.length ){
|
|
24 result.push( $previous[0] );
|
|
25 $previous = $previous.prev();
|
|
26 }
|
|
27 });
|
|
28
|
|
29 return shoestring( result );
|
|
30 };
|
|
31
|
|
32 //>>excludeStart("exclude", pragmas.exclude);
|
|
33 });
|
|
34 //>>excludeEnd("exclude");
|