mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	current image indicator fading on fast scrolls, done...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									414dae016e
								
							
						
					
					
						commit
						1cc214b12f
					
				| @ -69,11 +69,11 @@ body { | |||||||
| /* XXX not 100% sure about this... | /* XXX not 100% sure about this... | ||||||
| */ | */ | ||||||
| :not(.no-transitions) .current-marker:not(.no-transitions) { | :not(.no-transitions) .current-marker:not(.no-transitions) { | ||||||
| 	-webkit-transition: left 0.1s ease-out, opacity 0.5s ease; | 	-webkit-transition: left 0.1s ease-out; | ||||||
| 	-moz-transition: left 0.1s ease-out, opacity 0.5s ease; | 	-moz-transition: left 0.1s ease-out; | ||||||
| 	-ms-transition: left 0.1s ease-out, opacity 0.5s ease; | 	-ms-transition: left 0.1s ease-out; | ||||||
| 	-o-transition: left 0.1s ease-out, opacity 0.5s ease; | 	-o-transition: left 0.1s ease-out; | ||||||
| 	transition: left 0.1s ease-out, opacity 0.5s ease; | 	transition: left 0.1s ease-out; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /* XXX should this be !important */ | /* XXX should this be !important */ | ||||||
|  | |||||||
| @ -1862,6 +1862,8 @@ module.CurrentImageIndicator = Feature({ | |||||||
| 		'current-image-shift-timeout': 200, | 		'current-image-shift-timeout': 200, | ||||||
| 
 | 
 | ||||||
| 		'current-image-indicator-fadein': 500, | 		'current-image-indicator-fadein': 500, | ||||||
|  | 
 | ||||||
|  | 		'current-image-indicator-hide-timeout': 250, | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 	actions: CurrentImageIndicatorActions, | 	actions: CurrentImageIndicatorActions, | ||||||
| @ -1930,22 +1932,22 @@ module.CurrentImageIndicator = Feature({ | |||||||
| 				} | 				} | ||||||
| 			}], | 			}], | ||||||
| 
 | 
 | ||||||
| 		// XXX experimental...
 | 		// XXX experimental -- not sure if we need this...
 | ||||||
| 		// XXX move all the sittings into .config
 | 		// NOTE: we use .pre events here to see if we have moved...
 | ||||||
| 		// XXX BUG: this does not restore the indicator in some situations...
 |  | ||||||
| 		// 		to reproduce:
 |  | ||||||
| 		// 			do the action twice, fast.
 |  | ||||||
| 		['prevScreen.pre nextScreen.pre', | 		['prevScreen.pre nextScreen.pre', | ||||||
| 			function(){  | 			function(){  | ||||||
| 				var t = 250 |  | ||||||
| 				var m = this.ribbons.viewer.find('.current-marker') | 				var m = this.ribbons.viewer.find('.current-marker') | ||||||
|  | 				var t = this.config['current-image-indicator-hide-timeout'] | ||||||
|  | 
 | ||||||
| 				var cur = this.current | 				var cur = this.current | ||||||
| 
 | 
 | ||||||
| 				return function(){ | 				return function(){ | ||||||
| 					var that = this | 					var that = this | ||||||
| 
 | 
 | ||||||
| 					// delay fadeout...
 | 					// delay fadeout...
 | ||||||
| 					if(cur != this.current && m.css('opacity') != 0){ | 					if(cur != this.current  | ||||||
|  | 							&& m.css('opacity') == 1 | ||||||
|  | 							&& this.__current_indicator_t0 == null){ | ||||||
| 						this.__current_indicator_t0 = setTimeout(function(){ | 						this.__current_indicator_t0 = setTimeout(function(){ | ||||||
| 							delete that.__current_indicator_t0 | 							delete that.__current_indicator_t0 | ||||||
| 
 | 
 | ||||||
| @ -1953,12 +1955,12 @@ module.CurrentImageIndicator = Feature({ | |||||||
| 						}, t) | 						}, t) | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					// cancel previous fadein...
 | 					// cancel/delay previous fadein...
 | ||||||
| 					if(this.__current_indicator_t1 != null){ | 					if(this.__current_indicator_t1 != null){ | ||||||
| 						clearTimeout(this.__current_indicator_t1) | 						clearTimeout(this.__current_indicator_t1) | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					// cancel fadeout or do fadein...
 | 					// cancel fadeout and do fadein...
 | ||||||
| 					this.__current_indicator_t1 = setTimeout(function(){ | 					this.__current_indicator_t1 = setTimeout(function(){ | ||||||
| 						delete that.__current_indicator_t1 | 						delete that.__current_indicator_t1 | ||||||
| 
 | 
 | ||||||
| @ -1969,9 +1971,7 @@ module.CurrentImageIndicator = Feature({ | |||||||
| 						}  | 						}  | ||||||
| 
 | 
 | ||||||
| 						// show...
 | 						// show...
 | ||||||
| 						if(m.css('opacity') == 0){ | 						m.animate({ opacity: '1' }) | ||||||
| 							m.css({ opacity: '' }) |  | ||||||
| 						} |  | ||||||
| 					}, t-50) | 					}, t-50) | ||||||
| 				} | 				} | ||||||
| 			}], | 			}], | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user