mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	reworked the blink mechanics...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									3e1aeb3f7b
								
							
						
					
					
						commit
						26a5a6ba43
					
				| @ -430,6 +430,7 @@ var StatusBarActions = actions.Actions({ | |||||||
| 			return item | 			return item | ||||||
| 		}, | 		}, | ||||||
| 		// XXX show menu in the appropriate corner...
 | 		// XXX show menu in the appropriate corner...
 | ||||||
|  | 		// XXX remove the type+ed class...
 | ||||||
| 		mark: function(item, gid, img){ | 		mark: function(item, gid, img){ | ||||||
| 			// cleanup...
 | 			// cleanup...
 | ||||||
| 			if(item == null){ | 			if(item == null){ | ||||||
| @ -442,7 +443,7 @@ var StatusBarActions = actions.Actions({ | |||||||
| 			if(typeof(item) == typeof('str')){ | 			if(typeof(item) == typeof('str')){ | ||||||
| 				var type = item | 				var type = item | ||||||
| 				item = $('<span>') | 				item = $('<span>') | ||||||
| 					.addClass(type + 'ed') | 					.addClass(type + 'ed '+ type) | ||||||
| 					.attr('info', 'Image ' | 					.attr('info', 'Image ' | ||||||
| 						+(type == 'mark' ? 'selection' : 'bookmark') | 						+(type == 'mark' ? 'selection' : 'bookmark') | ||||||
| 						+' status (click to toggle)') | 						+' status (click to toggle)') | ||||||
| @ -475,23 +476,11 @@ var StatusBarActions = actions.Actions({ | |||||||
| 					'removeClass'  | 					'removeClass'  | ||||||
| 					: 'addClass']('on') | 					: 'addClass']('on') | ||||||
| 
 | 
 | ||||||
| 			// blink the indicator on...
 |  | ||||||
| 			// XXX need to do this on change only and not on navigation...
 |  | ||||||
| 			if(!on  |  | ||||||
| 					&& item.hasClass('on')  |  | ||||||
| 					&& this.config['status-bar-blink'].indexOf(this.toggleStatusBar('?')) >= 0){ |  | ||||||
| 				item |  | ||||||
| 					.removeClass('blink') |  | ||||||
| 					.addClass('blink') |  | ||||||
| 					.on('animationend', function(){ item.removeClass('blink') }) |  | ||||||
| 			} |  | ||||||
| 
 |  | ||||||
| 			return item | 			return item | ||||||
| 		}, | 		}, | ||||||
| 		bookmark: 'mark',  | 		bookmark: 'mark',  | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 	toggleStatusBar: ['Interface/Status bar mode', | 	toggleStatusBar: ['Interface/Status bar mode', | ||||||
| 		core.doc` | 		core.doc` | ||||||
| 
 | 
 | ||||||
| @ -662,6 +651,26 @@ var StatusBarActions = actions.Actions({ | |||||||
| 			this.toggleStatusBar(mode) | 			this.toggleStatusBar(mode) | ||||||
| 		}], | 		}], | ||||||
| 
 | 
 | ||||||
|  | 	// XXX should this blink the on state only???
 | ||||||
|  | 	statusItemBlink: ['- Interface/', | ||||||
|  | 		core.doc` | ||||||
|  | 		 | ||||||
|  | 		NOTE: type is the same as in .__statusbar_elements__`,
 | ||||||
|  | 		function(type){ | ||||||
|  | 			if(type == null){ | ||||||
|  | 				return | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			var gid = this.current | ||||||
|  | 			var item = this.dom.find(`.state-indicator-container.global-info .${type}`)  | ||||||
|  | 
 | ||||||
|  | 			// blink the indicator...
 | ||||||
|  | 			item | ||||||
|  | 				.removeClass('blink') | ||||||
|  | 				.addClass('blink') | ||||||
|  | 				.on('animationend', function(){ item.removeClass('blink') }) | ||||||
|  | 		}], | ||||||
|  | 
 | ||||||
| 	// XXX should these be here???
 | 	// XXX should these be here???
 | ||||||
| 	// XXX should this show a dialog???
 | 	// XXX should this show a dialog???
 | ||||||
| 	editStatusBarIndex: ['- Interface/Edit image focus position in statusbar', | 	editStatusBarIndex: ['- Interface/Edit image focus position in statusbar', | ||||||
| @ -754,6 +763,16 @@ module.StatusBar = core.ImageGridFeatures.Feature({ | |||||||
| 				gid == this.data.getRibbon() && this.updateStatusBar() | 				gid == this.data.getRibbon() && this.updateStatusBar() | ||||||
| 			}], | 			}], | ||||||
| 
 | 
 | ||||||
|  | 		// blink status mark indicators on toggle...
 | ||||||
|  | 		['toggleMark', | ||||||
|  | 			function(){ | ||||||
|  | 				this.toggleStatusBar('?') == 'hidden' | ||||||
|  | 					&& this.statusItemBlink('mark') }], | ||||||
|  | 		['toggleBookmark', | ||||||
|  | 			function(){ | ||||||
|  | 				this.toggleStatusBar('?') == 'hidden' | ||||||
|  | 					&& this.statusItemBlink('bookmark') }], | ||||||
|  | 
 | ||||||
| 		// Workspace...
 | 		// Workspace...
 | ||||||
| 		['saveWorkspace', | 		['saveWorkspace', | ||||||
| 			core.makeWorkspaceConfigWriter( | 			core.makeWorkspaceConfigWriter( | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user