mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-11-04 05:10:07 +00:00 
			
		
		
		
	extendRibbon now done (correctly accounts for left add/remove), loadImages still broken...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									445980802d
								
							
						
					
					
						commit
						0b9dbeb343
					
				@ -330,16 +330,25 @@ function extendRibbon(left, right, ribbon){
 | 
			
		||||
	// normalize position...
 | 
			
		||||
	// NOTE: this is fool-proof as it's based on relative visual 
 | 
			
		||||
	// 		position...
 | 
			
		||||
	var position_updated = false
 | 
			
		||||
	var post = getRelativeVisualPosition($('.viewer'), ribbon).left
 | 
			
		||||
	var scale = getElementScale($('.ribbon-set'))
 | 
			
		||||
	var l = parseFloat(ribbon.css('left'))
 | 
			
		||||
	l = isNaN(l) ? 0 : l
 | 
			
		||||
	if(pre != post){
 | 
			
		||||
		var scale = getElementScale($('.ribbon-set'))
 | 
			
		||||
		var l = parseFloat(ribbon.css('left'))
 | 
			
		||||
		l = isNaN(l) ? 0 : l
 | 
			
		||||
		position_updated = true
 | 
			
		||||
		l = l + (pre - post)/scale
 | 
			
		||||
	}
 | 
			
		||||
	if(left != 0){
 | 
			
		||||
		position_updated = true
 | 
			
		||||
		l -= left * images.outerWidth()
 | 
			
		||||
	}
 | 
			
		||||
	if(position_updated){
 | 
			
		||||
		// XXX do not do this unless l is changed...
 | 
			
		||||
		ribbon.css({
 | 
			
		||||
			left: l + (pre - post)/scale,
 | 
			
		||||
			left: l,
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
	// compensate for the truncation...
 | 
			
		||||
 | 
			
		||||
	return res
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user