mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	adding make.batch(..)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									7ff66bff49
								
							
						
					
					
						commit
						c0dd13342a
					
				| @ -1205,10 +1205,39 @@ function(title, options){ | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| // XXX like .makeEditor(..) but local to make(..) (i.e. generic)...
 | // XXX like .makeEditor(..) but local to make(..) (i.e. generic)...
 | ||||||
|  | // XXX should we have a batch callback???
 | ||||||
|  | // 		...otherwise what's the point in this?
 | ||||||
|  | // XXX TEST...
 | ||||||
| //browse.items.makeEditor =
 | //browse.items.makeEditor =
 | ||||||
| browse.items.makeBatch = | browse.items.batch = | ||||||
| function(spec, callback){ | function(spec, callback){ | ||||||
|  | 	var that = this | ||||||
|  | 
 | ||||||
|  | 	// build the fields...
 | ||||||
|  | 	;(spec || []) | ||||||
|  | 		.forEach(function(field){ | ||||||
|  | 			// array...
 | ||||||
|  | 			field instanceof Array ? | ||||||
|  | 				make(...field) | ||||||
|  | 			// spec...
 | ||||||
|  | 			: field instanceof Object ? | ||||||
|  | 				// XXX add support for field paths...
 | ||||||
|  | 				//filed.type.split('.')
 | ||||||
|  | 				//	.reduce(function(res, cur){
 | ||||||
|  | 				//		return res[cur] }, this)(field.text, field)
 | ||||||
|  | 				this[field.type || 'field'](field.text, field) | ||||||
|  | 			// other...
 | ||||||
|  | 			: make(field) }) | ||||||
|  | 
 | ||||||
|  | 	// batch callback...
 | ||||||
|  | 	callback | ||||||
|  | 		&& this.dialog | ||||||
|  | 			.close(function(){ | ||||||
|  | 				// XXX get the field data...
 | ||||||
| 				// XXX
 | 				// XXX
 | ||||||
|  | 			}) | ||||||
|  | 	 | ||||||
|  | 	return this | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user