mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	fixed a load bug that could lead to inconsistently versioned indexes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									3c6eddb6f4
								
							
						
					
					
						commit
						835fc0492d
					
				| @ -1214,6 +1214,10 @@ core.ImageGridFeatures.Feature({ | |||||||
| 			function(){ this.markChanged('all') }], | 			function(){ this.markChanged('all') }], | ||||||
| 
 | 
 | ||||||
| 		// data...
 | 		// data...
 | ||||||
|  | 		['load', | ||||||
|  | 			function(){ | ||||||
|  | 				this.data.version_updated | ||||||
|  | 					&& this.markChanged('all') }], | ||||||
| 		[[ | 		[[ | ||||||
| 			//'load',
 | 			//'load',
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -979,7 +979,11 @@ module.FileSystemLoader = core.ImageGridFeatures.Feature({ | |||||||
| 					var that = this | 					var that = this | ||||||
| 					res.then( | 					res.then( | ||||||
| 						function(){  | 						function(){  | ||||||
| 							that.markChanged('none') }, | 							// NOTE: this repeats the functionality in 
 | ||||||
|  | 							// 		base.js' 'edit' feature...
 | ||||||
|  | 							that.data.version_updated ? | ||||||
|  | 								that.markChanged('all')  | ||||||
|  | 								: that.markChanged('none') }, | ||||||
| 						function(){}) } }], | 						function(){}) } }], | ||||||
| 		// mark everything changed when loading images...
 | 		// mark everything changed when loading images...
 | ||||||
| 		['loadImages', | 		['loadImages', | ||||||
| @ -2549,10 +2553,7 @@ module.FileSystemWriter = core.ImageGridFeatures.Feature({ | |||||||
| 					//this.markChanged('none')
 | 					//this.markChanged('none')
 | ||||||
| 					var that = this | 					var that = this | ||||||
| 					res.then(function(){ | 					res.then(function(){ | ||||||
| 						that.markChanged('none') | 						that.markChanged('none') }) } }], | ||||||
| 					}) |  | ||||||
| 				} |  | ||||||
| 			}], |  | ||||||
| 	], | 	], | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -2723,7 +2723,14 @@ var DataPrototype = { | |||||||
| 	load: function(data, clean){ | 	load: function(data, clean){ | ||||||
| 		var that = this | 		var that = this | ||||||
| 		data = typeof(data) == typeof('str') ? JSON.parse(data) : data | 		data = typeof(data) == typeof('str') ? JSON.parse(data) : data | ||||||
|  | 		var version = data.version | ||||||
| 		data = formats.updateData(data, DATA_VERSION) | 		data = formats.updateData(data, DATA_VERSION) | ||||||
|  | 
 | ||||||
|  | 		// report version change...
 | ||||||
|  | 		delete this.version_updated | ||||||
|  | 		if(data.version != version){ | ||||||
|  | 			this.version_updated = true } | ||||||
|  | 
 | ||||||
| 		this.order = data.order.slice() | 		this.order = data.order.slice() | ||||||
| 		this.ribbon_order = data.ribbon_order.slice() | 		this.ribbon_order = data.ribbon_order.slice() | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user