Combine logic for forward and backward shift-selects.
This commit is contained in:
		
							parent
							
								
									70d0e64309
								
							
						
					
					
						commit
						b6890bfd2c
					
				
					 1 changed files with 3 additions and 5 deletions
				
			
		|  | @ -127,13 +127,11 @@ function on_photo_select(event) | ||||||
|         { |         { | ||||||
|             slice = [current_photo_div]; |             slice = [current_photo_div]; | ||||||
|         } |         } | ||||||
|         else if (previous_index < current_index) |  | ||||||
|         { |  | ||||||
|             slice = photo_divs.slice(previous_index, current_index + 1); |  | ||||||
|         } |  | ||||||
|         else |         else | ||||||
|         { |         { | ||||||
|             slice = photo_divs.slice(current_index, previous_index + 1); |             var left = Math.min(previous_index, current_index); | ||||||
|  |             var right = Math.max(previous_index, current_index); | ||||||
|  |             slice = photo_divs.slice(left, right + 1); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         slice.forEach(action); |         slice.forEach(action); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue