mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	cleaned up caps indicator...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									43c881075c
								
							
						
					
					
						commit
						a337fd5861
					
				| @ -88,6 +88,8 @@ var StatusBarActions = actions.Actions({ | |||||||
| 		'status-bar-ribbon-count': true, | 		'status-bar-ribbon-count': true, | ||||||
| 
 | 
 | ||||||
| 		'status-bar-changes-text': '*', | 		'status-bar-changes-text': '*', | ||||||
|  | 
 | ||||||
|  | 		'status-bar-edit-mode-indicator-update-interval': 1000, | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 	__statusbar_elements__: { | 	__statusbar_elements__: { | ||||||
| @ -385,7 +387,19 @@ var StatusBarActions = actions.Actions({ | |||||||
| 						[caps ? 'addClass' : 'removeClass']('on') | 						[caps ? 'addClass' : 'removeClass']('on') | ||||||
| 				}).bind(this) | 				}).bind(this) | ||||||
| 
 | 
 | ||||||
|  | 			// cleanup interval handling...
 | ||||||
|  | 			this.__edit_mode_indicator_update_interval | ||||||
|  | 				&& clearInterval(this.__edit_mode_indicator_update_interval) | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 			// cleanup...
 | ||||||
|  | 			if(item == null){ | ||||||
|  | 				this.off('keyPress', update) | ||||||
|  | 				this.dom.off('focus', update) | ||||||
|  | 				return | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			// setup...
 | ||||||
| 			if(typeof(item) == typeof('str')){ | 			if(typeof(item) == typeof('str')){ | ||||||
| 				var type = item | 				var type = item | ||||||
| 				item = $('<span>') | 				item = $('<span>') | ||||||
| @ -396,10 +410,18 @@ var StatusBarActions = actions.Actions({ | |||||||
| 						.text('Edit mode')) | 						.text('Edit mode')) | ||||||
| 					.click(update) | 					.click(update) | ||||||
| 
 | 
 | ||||||
| 				// XXX need a way to cleanly unhandle this...
 |  | ||||||
| 				this.on('keyPress', update) | 				this.on('keyPress', update) | ||||||
|  | 				this.dom.focus(update) | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | 			// update timer...
 | ||||||
|  | 			// NOTE: this is needed so as to reflect changes to settings...
 | ||||||
|  | 			var t = this.config['status-bar-edit-mode-indicator-update-interval'] | ||||||
|  | 			t = t == null ? 5000 : t | ||||||
|  | 			if(t){ | ||||||
|  | 				this.__edit_mode_indicator_update_interval = setInterval(update, t) } | ||||||
|  | 
 | ||||||
|  | 			// update state...
 | ||||||
| 			update() | 			update() | ||||||
| 
 | 
 | ||||||
| 			return item | 			return item | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user