mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	moved the Data init code to ._reset() instance method (still thinking about it)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									2a8d005f52
								
							
						
					
					
						commit
						f936060d3e
					
				
							
								
								
									
										20
									
								
								ui/data4.js
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								ui/data4.js
									
									
									
									
									
								
							| @ -131,6 +131,16 @@ var DataClassPrototype = { | |||||||
| // 		NOTE: ribbons are sparse...
 | // 		NOTE: ribbons are sparse...
 | ||||||
| //
 | //
 | ||||||
| var DataPrototype = { | var DataPrototype = { | ||||||
|  | 	_reset: function(){ | ||||||
|  | 		this.base = null | ||||||
|  | 		this.current = null | ||||||
|  | 		this.order = []  | ||||||
|  | 		this.ribbon_order = []  | ||||||
|  | 		this.ribbons = {} | ||||||
|  | 
 | ||||||
|  | 		this._gid_cache = [] | ||||||
|  | 	}, | ||||||
|  | 
 | ||||||
| 	// util methods...
 | 	// util methods...
 | ||||||
| 	compactSparseList: function(list){ | 	compactSparseList: function(list){ | ||||||
| 		return list.filter(function(){return true}) | 		return list.filter(function(){return true}) | ||||||
| @ -900,17 +910,11 @@ function Data(json){ | |||||||
| 		obj = this | 		obj = this | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	obj.base = null |  | ||||||
| 	obj.current = null |  | ||||||
| 	obj.order = []  |  | ||||||
| 	obj.ribbon_order = []  |  | ||||||
| 	obj.ribbons = {} |  | ||||||
| 
 |  | ||||||
| 	obj._gid_cache = [] |  | ||||||
| 
 |  | ||||||
| 	// load initial state...
 | 	// load initial state...
 | ||||||
| 	if(json != null){ | 	if(json != null){ | ||||||
| 		obj.loadJSON(json) | 		obj.loadJSON(json) | ||||||
|  | 	} else { | ||||||
|  | 		obj._reset() | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return obj | 	return obj | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user