mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	fixed a bug in .toggleSingeImage(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									01797476e4
								
							
						
					
					
						commit
						964483c1bb
					
				| @ -289,7 +289,7 @@ var WorkspaceActions = actions.Actions({ | ||||
| 	// 		save nothing. this us useful for introspection and temporary
 | ||||
| 	// 		context storage.
 | ||||
| 	//
 | ||||
| 	// XXX for some reason this does not trigger a .config save...
 | ||||
| 	// XXX for some reason this does not get saved with .config...
 | ||||
| 	saveWorkspace: ['Workspace/Save Workspace', | ||||
| 		function(name){ | ||||
| 			this.config['workspaces'] = this.config['workspaces'] | ||||
|  | ||||
| @ -130,6 +130,8 @@ var SlideshowActions = actions.Actions({ | ||||
| 
 | ||||
| 				// stop...
 | ||||
| 				} else { | ||||
| 					this.saveWorkspace('slideshow')  | ||||
| 
 | ||||
| 					// stop timer...
 | ||||
| 					this.__slideshouw_timer | ||||
| 						&& clearTimeout(this.__slideshouw_timer) | ||||
|  | ||||
| @ -453,7 +453,6 @@ module.StatusBar = core.ImageGridFeatures.Feature({ | ||||
| 			}], | ||||
| 
 | ||||
| 		// Workspace...
 | ||||
| 		// XXX is storing all the config a bit too much???
 | ||||
| 		['saveWorkspace', | ||||
| 			core.makeWorkspaceConfigWriter( | ||||
| 				function(){ return Object.keys(StatusBar.config) })], | ||||
|  | ||||
| @ -1818,7 +1818,6 @@ var SingleImageActions = actions.Actions({ | ||||
| 	}, | ||||
| 
 | ||||
| 	toggleSingleImage: ['Interface/Toggle single image view',  | ||||
| 		// XXX this is wrong!!!
 | ||||
| 		toggler.CSSClassToggler( | ||||
| 			function(){ return this.ribbons.viewer },  | ||||
| 			'single-image-mode') ], | ||||
| @ -1920,17 +1919,28 @@ module.SingleImageView = core.ImageGridFeatures.Feature({ | ||||
| 					this.config['ribbon-scale'] = this.screenwidth | ||||
| 				} | ||||
| 			}], | ||||
| 		// NOTE: this is not part of the actual action above because we 
 | ||||
| 		// 		need to see if the state has changed and doing this with 
 | ||||
| 		// 		two separate pre/post callbacks (toggler callbacks) is 
 | ||||
| 		// 		harder than with two nested callbacks (action callbacks)
 | ||||
| 		// XXX this uses .screenwidth for scale, is this the right way to go?
 | ||||
| 		['toggleSingleImage.post',  | ||||
| 		['toggleSingleImage.pre',  | ||||
| 			function(){  | ||||
| 				var pre_state = this.toggleSingleImage('?') | ||||
| 
 | ||||
| 				return function(){ | ||||
| 					var state = this.toggleSingleImage('?') | ||||
| 
 | ||||
| 					// singe image mode -- set image proportions...
 | ||||
| 				if(this.toggleSingleImage('?') == 'on'){ | ||||
| 					if(state == 'on'){ | ||||
| 						updateImageProportions.call(this) | ||||
| 
 | ||||
| 						// update scale...
 | ||||
| 						if(state != pre_state){ | ||||
| 							var w = this.screenwidth | ||||
| 							this.config['ribbon-scale'] = w | ||||
| 							this.screenwidth = this.config['single-image-scale'] || w | ||||
| 						} | ||||
| 
 | ||||
| 					// ribbon mode -- restore original image size...
 | ||||
| 					} else { | ||||
| @ -1940,10 +1950,13 @@ module.SingleImageView = core.ImageGridFeatures.Feature({ | ||||
| 						}) | ||||
| 
 | ||||
| 						// update scale...
 | ||||
| 						if(state != pre_state){ | ||||
| 							var w = this.screenwidth | ||||
| 							this.config['single-image-scale'] = w | ||||
| 							this.screenwidth = this.config['ribbon-scale'] || w | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 			}], | ||||
| 	], | ||||
| }) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user