mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 11:20:09 +00:00 
			
		
		
		
	split out the progress container getter, now progress should be panel compatible...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									59caf58c1f
								
							
						
					
					
						commit
						4d71983dcd
					
				| @ -672,7 +672,6 @@ jQuery.fn.sortChildren = function(func){ | |||||||
| // 				.on('deplete', func) -> pool
 | // 				.on('deplete', func) -> pool
 | ||||||
| //
 | //
 | ||||||
| // XXX should this be an object or a factory???
 | // XXX should this be an object or a factory???
 | ||||||
| // XXX add a clean handler removal scheme (a-la jQuery event on/off)
 |  | ||||||
| function makeDeferredPool(size, paused){ | function makeDeferredPool(size, paused){ | ||||||
| 	size = size == null ? POOL_SIZE : size | 	size = size == null ? POOL_SIZE : size | ||||||
| 	size = size < 0 ? 1  | 	size = size < 0 ? 1  | ||||||
|  | |||||||
| @ -14,13 +14,7 @@ var WORKERS = {} | |||||||
| 
 | 
 | ||||||
| /**************************************************** Progress bar ***/ | /**************************************************** Progress bar ***/ | ||||||
| 
 | 
 | ||||||
| // NOTE: if the progress widget gets removed without removing the worker
 | function getWorkerProgressFloatingContainer(parent){ | ||||||
| // 		this will result in dangling handlers for the previous widget...
 |  | ||||||
| // 		i.e. handlers that still reverence the original widget...
 |  | ||||||
| //
 |  | ||||||
| // XXX add a clean removal scheme...
 |  | ||||||
| // XXX should this have a pause button???
 |  | ||||||
| function makeWorkerProgressBar(name, worker, parent){ |  | ||||||
| 	parent = parent == null ? $('.viewer') : parent | 	parent = parent == null ? $('.viewer') : parent | ||||||
| 
 | 
 | ||||||
| 	// widget container...
 | 	// widget container...
 | ||||||
| @ -30,9 +24,24 @@ function makeWorkerProgressBar(name, worker, parent){ | |||||||
| 			.appendTo(parent) | 			.appendTo(parent) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	return container | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // NOTE: if the progress widget gets removed without removing the worker
 | ||||||
|  | // 		this will result in dangling handlers for the previous widget...
 | ||||||
|  | // 		i.e. handlers that still reverence the original widget...
 | ||||||
|  | //
 | ||||||
|  | // XXX add a clean removal scheme...
 | ||||||
|  | // XXX should this have a pause button???
 | ||||||
|  | function getWorkerProgressBar(name, worker, container){ | ||||||
|  | 	container = container == null  | ||||||
|  | 		? getWorkerProgressFloatingContainer()  | ||||||
|  | 		: container | ||||||
|  | 
 | ||||||
| 	var widget = $('.progress-bar[name="'+name+'"]') | 	var widget = $('.progress-bar[name="'+name+'"]') | ||||||
| 
 | 
 | ||||||
| 	// a progress bar already exists, reset it and return...
 | 	// a progress bar already exists, reset it and return...
 | ||||||
|  | 	// XXX should we re-bind the event handlers here???
 | ||||||
| 	if(widget.length > 0){ | 	if(widget.length > 0){ | ||||||
| 		widget | 		widget | ||||||
| 			.css('display', '') | 			.css('display', '') | ||||||
| @ -109,7 +118,7 @@ function getWorkerQueue(name, pool_size, no_auto_start, no_progress){ | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if(!no_progress){ | 	if(!no_progress){ | ||||||
| 		makeWorkerProgressBar(name, queue) | 		getWorkerProgressBar(name, queue) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return queue | 	return queue | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user