mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 11:20:09 +00:00 
			
		
		
		
	added first modal open/close events and now we pause the slideshow on modal stuff...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									7c0a63e836
								
							
						
					
					
						commit
						c9423b32e6
					
				| @ -391,8 +391,19 @@ module.Slideshow = core.ImageGridFeatures.Feature({ | |||||||
| 					this.dom.off('mouseup', release) | 					this.dom.off('mouseup', release) | ||||||
| 					this.dom.off('touchend', toggle) | 					this.dom.off('touchend', toggle) | ||||||
| 				} | 				} | ||||||
| 			}] | 			}], | ||||||
| 		//*/
 | 		//*/
 | ||||||
|  | 
 | ||||||
|  | 		// pause/resume slideshow on modal stuff...
 | ||||||
|  | 		['firstModalOpen', | ||||||
|  | 			function(){  | ||||||
|  | 				if(this.toggleSlideshow('?') == 'on'  | ||||||
|  | 						&& this.toggleSlideshowTimer('?') == 'running'){ | ||||||
|  | 					this.toggleSlideshowTimer('paused')  | ||||||
|  | 					this.one('lastModalClose', function(){ | ||||||
|  | 						this.toggleSlideshowTimer('running') }) | ||||||
|  | 				} | ||||||
|  | 			}], | ||||||
| 	], | 	], | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -356,6 +356,12 @@ var makeUIContainer = | |||||||
| module.makeUIContainer = function(make){ | module.makeUIContainer = function(make){ | ||||||
| 	return uiContainer(function(){ | 	return uiContainer(function(){ | ||||||
| 		var that = this | 		var that = this | ||||||
|  | 
 | ||||||
|  | 		// trigger the general modal open event...
 | ||||||
|  | 		that.modal | ||||||
|  | 			// XXX do we need to pass anything here????
 | ||||||
|  | 			|| that.firstModalOpen()  | ||||||
|  | 
 | ||||||
| 		var o = make.apply(this, arguments) | 		var o = make.apply(this, arguments) | ||||||
| 
 | 
 | ||||||
| 		o | 		o | ||||||
| @ -381,6 +387,11 @@ module.makeUIContainer = function(make){ | |||||||
| 						// 						is in focus but keys are not 
 | 						// 						is in focus but keys are not 
 | ||||||
| 						// 						tracked...
 | 						// 						tracked...
 | ||||||
| 						: that.dom.focus() | 						: that.dom.focus() | ||||||
|  | 
 | ||||||
|  | 					// trigger the general modal close event...
 | ||||||
|  | 					that.modal | ||||||
|  | 						// XXX do we need to pass anything here????
 | ||||||
|  | 						|| that.lastModalClose()  | ||||||
| 				}) | 				}) | ||||||
| 				// Compensate for click focusing the parent dialog when
 | 				// Compensate for click focusing the parent dialog when
 | ||||||
| 				// a child is created...
 | 				// a child is created...
 | ||||||
| @ -746,6 +757,21 @@ var DialogsActions = actions.Actions({ | |||||||
| 			return panel | 			return panel | ||||||
| 		})], | 		})], | ||||||
| 
 | 
 | ||||||
|  | 	// Events...
 | ||||||
|  | 	firstModalOpen: ['- Interface/', | ||||||
|  | 		core.Event(function(gid){ | ||||||
|  | 			// Triggered when the first modal container is opened.
 | ||||||
|  | 			//
 | ||||||
|  | 			// Not for direct use.
 | ||||||
|  | 		})], | ||||||
|  | 	// XXX due to that .close() can be called a couple of times this can 
 | ||||||
|  | 	// 		also be called a couple of times...
 | ||||||
|  | 	lastModalClose: ['- Interface/', | ||||||
|  | 		core.Event(function(gid){ | ||||||
|  | 			// Triggered when the last modal container is closed.
 | ||||||
|  | 			//
 | ||||||
|  | 			// Not for direct use.
 | ||||||
|  | 		})], | ||||||
| 
 | 
 | ||||||
| 	// Helper for creating lists fast...
 | 	// Helper for creating lists fast...
 | ||||||
| 	showList: ['- Interface/',  | 	showList: ['- Interface/',  | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user