mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-11-04 13:20:10 +00:00 
			
		
		
		
	some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									9933b2ded2
								
							
						
					
					
						commit
						0d108eb5f1
					
				
							
								
								
									
										11
									
								
								ui/data.js
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								ui/data.js
									
									
									
									
									
								
							@ -1229,6 +1229,9 @@ function updateImage(image, gid, size){
 | 
				
			|||||||
	// flip...
 | 
						// flip...
 | 
				
			||||||
	setImageFlipState(image, img_data.flipped == null ? [] : img_data.flipped)
 | 
						setImageFlipState(image, img_data.flipped == null ? [] : img_data.flipped)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// NOTE: this only has effect on non-square image blocks...
 | 
				
			||||||
 | 
						correctImageProportionsForRotation(image)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// marks...
 | 
						// marks...
 | 
				
			||||||
	if(MARKED.indexOf(gid) != -1){
 | 
						if(MARKED.indexOf(gid) != -1){
 | 
				
			||||||
		image.addClass('marked')
 | 
							image.addClass('marked')
 | 
				
			||||||
@ -1236,8 +1239,6 @@ function updateImage(image, gid, size){
 | 
				
			|||||||
		image.removeClass('marked')
 | 
							image.removeClass('marked')
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	correctImageProportionsForRotation(image)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return image
 | 
						return image
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1465,9 +1466,6 @@ function loadImagesAround(count, gid, ribbon, data){
 | 
				
			|||||||
		$('.viewer').trigger('updatedRibbon', [ribbon_elem])
 | 
							$('.viewer').trigger('updatedRibbon', [ribbon_elem])
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// XXX is this the right place for this?
 | 
					 | 
				
			||||||
	// XXX this might be too global, do only the images loaded...
 | 
					 | 
				
			||||||
	//correctImageProportionsForRotation(images)
 | 
					 | 
				
			||||||
	return images
 | 
						return images
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1516,8 +1514,6 @@ function rollImages(n, ribbon, extend, no_compensate_shift){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	$('.viewer').trigger('updatedRibbon', [ribbon])
 | 
						$('.viewer').trigger('updatedRibbon', [ribbon])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// XXX is this the right place for this?
 | 
					 | 
				
			||||||
	//correctImageProportionsForRotation(images)
 | 
					 | 
				
			||||||
	return images
 | 
						return images
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1541,7 +1537,6 @@ function reloadViewer(images_per_screen){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// create images...
 | 
						// create images...
 | 
				
			||||||
	$('.ribbon').each(function(i, e){
 | 
						$('.ribbon').each(function(i, e){
 | 
				
			||||||
		//loadImages(current, Math.min(w * LOAD_SCREENS, DATA.ribbons[i].length), $(this))
 | 
					 | 
				
			||||||
		loadImagesAround(Math.round(w * LOAD_SCREENS), current, i)
 | 
							loadImagesAround(Math.round(w * LOAD_SCREENS), current, i)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -837,7 +837,11 @@ function nextRibbon(){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Compensate for viewer proportioned and rotated images.
 | 
					// Compensate for viewer proportioned and rotated images.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// NOTE: this is not neede for square image blocks.
 | 
					// This will set the margins so as to make the rotated image offset the
 | 
				
			||||||
 | 
					// same space as it is occupying visually...
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// NOTE: this is not needed for square image blocks.
 | 
				
			||||||
 | 
					// NOTE: if an image block is square, this will remove the margins.
 | 
				
			||||||
function correctImageProportionsForRotation(images){
 | 
					function correctImageProportionsForRotation(images){
 | 
				
			||||||
	var viewer = $('.viewer')
 | 
						var viewer = $('.viewer')
 | 
				
			||||||
	var W = viewer.innerWidth()
 | 
						var W = viewer.innerWidth()
 | 
				
			||||||
 | 
				
			|||||||
@ -99,7 +99,6 @@ function setupDataBindings(viewer){
 | 
				
			|||||||
					// likely due to shifting...
 | 
										// likely due to shifting...
 | 
				
			||||||
					|| ( gr.length > l 
 | 
										|| ( gr.length > l 
 | 
				
			||||||
						&& l < Math.round(screen_size * LOAD_SCREENS))){
 | 
											&& l < Math.round(screen_size * LOAD_SCREENS))){
 | 
				
			||||||
				//loadImages(gid, Math.round(screen_size * LOAD_SCREENS), ribbon)
 | 
					 | 
				
			||||||
				loadImagesAround(Math.round(screen_size * LOAD_SCREENS), gid, ribbon)
 | 
									loadImagesAround(Math.round(screen_size * LOAD_SCREENS), gid, ribbon)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// roll the ribbon while we are advancing...
 | 
								// roll the ribbon while we are advancing...
 | 
				
			||||||
@ -175,7 +174,6 @@ function setupDataBindings(viewer){
 | 
				
			|||||||
			var gid = getImageGID()
 | 
								var gid = getImageGID()
 | 
				
			||||||
			$('.ribbon').each(function(){
 | 
								$('.ribbon').each(function(){
 | 
				
			||||||
				var r = $(this)
 | 
									var r = $(this)
 | 
				
			||||||
				//loadImages(gid, Math.round(screen_size * LOAD_SCREENS), r)
 | 
					 | 
				
			||||||
				loadImagesAround(Math.round(screen_size * LOAD_SCREENS), gid, r)
 | 
									loadImagesAround(Math.round(screen_size * LOAD_SCREENS), gid, r)
 | 
				
			||||||
			})
 | 
								})
 | 
				
			||||||
			centerView(null, 'css')
 | 
								centerView(null, 'css')
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user