mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 11:20:09 +00:00 
			
		
		
		
	experimenting with walker construction...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									4b8b3dd64d
								
							
						
					
					
						commit
						5ce24233ab
					
				| @ -252,6 +252,18 @@ var makeItemEventMethod = function(event, handler){ | |||||||
| 	}) } | 	}) } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | var makeWalker = function(name, func, options){ | ||||||
|  | 	return function(...args){ | ||||||
|  | 		// XXX do we get passed options??
 | ||||||
|  | 		return this.walk2( | ||||||
|  | 			func, | ||||||
|  | 			function(children){ | ||||||
|  | 				return children[name](...args) }, | ||||||
|  | 			function(node){ | ||||||
|  | 				return node && node[name] instanceof Function }, | ||||||
|  | 			options || {}) } } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 | ||||||
| 
 | 
 | ||||||
| @ -1026,6 +1038,13 @@ var BaseBrowserPrototype = { | |||||||
| 					&& [ (options || {}).joinPaths !== false ?  | 					&& [ (options || {}).joinPaths !== false ?  | ||||||
| 						p.join('/')  | 						p.join('/')  | ||||||
| 						: p ] }, options) }, | 						: p ] }, options) }, | ||||||
|  | 	// XXX need to be able to update context (i.e. path) ...
 | ||||||
|  | 	paths3: makeWalker('path3', | ||||||
|  | 		function(n, i, p){ | ||||||
|  | 			return n  | ||||||
|  | 				&& [ (options || {}).joinPaths !== false ?  | ||||||
|  | 					p.join('/')  | ||||||
|  | 					: p ] }), | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// Extended map...
 | 	// Extended map...
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user