mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 19:30:07 +00:00 
			
		
		
		
	reworked the crop modes some more, now identical states will not get pushed to the state stack...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									d30849f387
								
							
						
					
					
						commit
						5ff3b12417
					
				
							
								
								
									
										10
									
								
								ui/data.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								ui/data.js
									
									
									
									
									
								
							| @ -1572,8 +1572,16 @@ function cropDataTo(gids, keep_ribbons){ | ||||
| 	var cur = DATA.current | ||||
| 	var r = getRibbonIndex() | ||||
| 
 | ||||
| 	var new_data = makeCroppedData(gids, keep_ribbons) | ||||
| 
 | ||||
| 	// do nothing if there is no change...
 | ||||
| 	// XXX is there a better way to compare states???
 | ||||
| 	if(JSON.stringify(DATA.ribbons) == JSON.stringify(new_data.ribbons)){ | ||||
| 		return DATA | ||||
| 	} | ||||
| 
 | ||||
| 	CROP_STACK.push(prev_state) | ||||
| 	DATA = makeCroppedData(gids, keep_ribbons) | ||||
| 	DATA = new_data | ||||
| 
 | ||||
| 	cur = getGIDBefore(cur, keep_ribbons ? r : 0) | ||||
| 	cur = cur == null ? gids[0] : cur | ||||
|  | ||||
| @ -59,8 +59,6 @@ var toggleMarkedOnlyView = createCSSClassToggler( | ||||
| 		}, | ||||
| 		function(action){ | ||||
| 			if(action == 'on'){ | ||||
| 				// XXX do nothing if there is no change...
 | ||||
| 				// XXX
 | ||||
| 				cropMarkedImages() | ||||
| 			} else { | ||||
| 				//uncropData()
 | ||||
|  | ||||
| @ -187,8 +187,6 @@ var toggleSingleRibbonMode = createCSSClassToggler( | ||||
| 		}, | ||||
| 		function(action){ | ||||
| 			if(action == 'on'){ | ||||
| 				// XXX do nothing if there is no change...
 | ||||
| 				// XXX
 | ||||
| 				cropDataTo(DATA.ribbons[getRibbonIndex()].slice()) | ||||
| 			} else { | ||||
| 				//uncropData()
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user