mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	fixed a bug with List.options.data contaminated when toggling showDisabled...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									f819acfa94
								
							
						
					
					
						commit
						9d632201e4
					
				| @ -225,12 +225,9 @@ var MetadataUIActions = actions.Actions({ | ||||
| 
 | ||||
| 	// XXX should we replace 'mode' with nested set of metadata???
 | ||||
| 	// XXX make this support multiple images...
 | ||||
| 	// XXX BUG: with mode 'disabled' key D enables elements but does not
 | ||||
| 	// 		hide them...
 | ||||
| 	showMetadata: ['Image/Show metadata', | ||||
| 		function(image, mode){ | ||||
| 			image = this.data.getImage(image) | ||||
| 			//mode = mode || 'short'
 | ||||
| 			mode = mode || 'disabled' | ||||
| 
 | ||||
| 			var field_order = this.config['metadata-field-order'] || [] | ||||
| @ -276,7 +273,10 @@ var MetadataUIActions = actions.Actions({ | ||||
| 			var o = overlay.Overlay(this.ribbons.viewer,  | ||||
| 				browse.makeList( | ||||
| 						null, | ||||
| 						fields) | ||||
| 						fields, | ||||
| 						{ | ||||
| 							showDisabled: false, | ||||
| 						}) | ||||
| 					// path selected...
 | ||||
| 					.open(function(evt, path){  | ||||
| 						// edit field...
 | ||||
| @ -288,6 +288,7 @@ var MetadataUIActions = actions.Actions({ | ||||
| 						*/ | ||||
| 					})) | ||||
| 					.close(function(){ | ||||
| 						// XXX
 | ||||
| 					}) | ||||
| 			o.client.dom.addClass('metadata-view') | ||||
| 
 | ||||
|  | ||||
| @ -348,8 +348,7 @@ var URLHistoryUIActions = actions.Actions({ | ||||
| 		// 	- [ 'open', 'close' ]	- explicitly select event
 | ||||
| 		'url-history-list-clear': ['open', 'close'], | ||||
| 	}, | ||||
| 	// XXX BUG: when running from action menu this breaks...
 | ||||
| 	// 			...possibly connected with restoring after .preventClosing(..)
 | ||||
| 	// XXX make availabilyty checking live (now on open dialog)...
 | ||||
| 	// XXX need to check items...
 | ||||
| 	// XXX use svg icons for buttons...
 | ||||
| 	listURLHistory: ['History|File/Show history', | ||||
| @ -375,7 +374,15 @@ var URLHistoryUIActions = actions.Actions({ | ||||
| 			var o = overlay.Overlay(this.ribbons.viewer,  | ||||
| 				browse.makeList( | ||||
| 						null,  | ||||
| 						Object.keys(this.url_history).reverse(), | ||||
| 						Object.keys(this.url_history) | ||||
| 							.reverse() | ||||
| 							// NOTE: this might get a little slow for 
 | ||||
| 							// 		very large sets...
 | ||||
| 							.map(function(p){ | ||||
| 								return !that.checkURLFromHistory(p) ?  | ||||
| 									'- ' + p  | ||||
| 									: p  | ||||
| 							}), | ||||
| 						{ | ||||
| 							// add item buttons...
 | ||||
| 							itemButtons: [ | ||||
| @ -433,9 +440,11 @@ var URLHistoryUIActions = actions.Actions({ | ||||
| 
 | ||||
| 			var list = o.client | ||||
| 
 | ||||
| 			/* | ||||
| 			Object.keys(this.url_history).reverse().forEach(function(p){ | ||||
| 				that.checkURLFromHistory(p) || list.filter(p).addClass('disabled') | ||||
| 			}) | ||||
| 			*/ | ||||
| 
 | ||||
| 			// select and highlight current path...
 | ||||
| 			cur && list | ||||
|  | ||||
| @ -2107,7 +2107,11 @@ ListPrototype.options = { | ||||
| 
 | ||||
| 						if(typeof(k) == typeof('str')){ | ||||
| 							n = tt | ||||
| 
 | ||||
| 						} else { | ||||
| 							// NOTE: here we want to avoid .data contamination
 | ||||
| 							// 		so we'll make a copy...
 | ||||
| 							n = n.slice() | ||||
| 							n[0] = tt | ||||
| 						} | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user