comparison default/node_modules/shoestring/src/dom/find.js @ 0:1d038bc9b3d2 default tip

Up:default
author Liny <dev@neowd.com>
date Sat, 31 May 2025 09:21:51 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d038bc9b3d2
1 //>>excludeStart("exclude", pragmas.exclude);
2 define([ "shoestring" ], function(){
3 //>>excludeEnd("exclude");
4
5 /**
6 * Find descendant elements of the current collection.
7 *
8 * @param {string} selector The selector used to find the children
9 * @return shoestring
10 * @this shoestring
11 */
12 shoestring.fn.find = function( selector ){
13 var ret = [],
14 finds;
15 this.each(function(){
16 //>>includeStart("development", pragmas.development);
17 try {
18 //>>includeEnd("development");
19 finds = this.querySelectorAll( selector );
20 //>>includeStart("development", pragmas.development);
21 } catch( e ) {
22 shoestring.error( 'queryselector', selector );
23 }
24 //>>includeEnd("development");
25
26 for( var i = 0, il = finds.length; i < il; i++ ){
27 ret = ret.concat( finds[i] );
28 }
29 });
30 return shoestring( ret );
31 };
32
33 //>>excludeStart("exclude", pragmas.exclude);
34 });
35 //>>excludeEnd("exclude");