mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-30 04:01:31 +08:00 
			
		
		
		
	frontend now correctly changes folder status during moving / creating / deleting notes
This commit is contained in:
		
							parent
							
								
									20a1e71100
								
							
						
					
					
						commit
						db21db18e8
					
				| @ -289,6 +289,11 @@ | |||||||
|                       url: baseUrl + 'notes/' + node.key, |                       url: baseUrl + 'notes/' + node.key, | ||||||
|                       type: 'DELETE', |                       type: 'DELETE', | ||||||
|                       success: function(result) { |                       success: function(result) { | ||||||
|  |                         if (node.getParent() != null && node.getParent().getChildren().length <= 1) { | ||||||
|  |                           node.getParent().folder = false; | ||||||
|  |                           node.getParent().renderTitle(); | ||||||
|  |                         } | ||||||
|  | 
 | ||||||
|                         node.remove(); |                         node.remove(); | ||||||
|                       } |                       } | ||||||
|                   }); |                   }); | ||||||
| @ -325,6 +330,11 @@ | |||||||
|                       type: 'PUT', |                       type: 'PUT', | ||||||
|                       contentType: "application/json", |                       contentType: "application/json", | ||||||
|                       success: function(result) { |                       success: function(result) { | ||||||
|  |                         if (node.getParent() != null && node.getParent().getChildren().length <= 1) { | ||||||
|  |                           node.getParent().folder = false; | ||||||
|  |                           node.getParent().renderTitle(); | ||||||
|  |                         } | ||||||
|  | 
 | ||||||
|                         node.moveTo(node.getParent(), 'after'); |                         node.moveTo(node.getParent(), 'after'); | ||||||
|                       } |                       } | ||||||
|                   }); |                   }); | ||||||
| @ -342,6 +352,9 @@ | |||||||
|                         node.moveTo(prevSibling); |                         node.moveTo(prevSibling); | ||||||
|                    |                    | ||||||
|                         prevSibling.setExpanded(true); |                         prevSibling.setExpanded(true); | ||||||
|  | 
 | ||||||
|  |                         prevSibling.folder = true; | ||||||
|  |                         prevSibling.renderTitle(); | ||||||
|                       } |                       } | ||||||
|                   }); |                   }); | ||||||
|                 } |                 } | ||||||
| @ -391,6 +404,9 @@ | |||||||
|           } |           } | ||||||
|           else { |           else { | ||||||
|             node.addChildren(newNode).setActive(true); |             node.addChildren(newNode).setActive(true); | ||||||
|  | 
 | ||||||
|  |             node.folder = true; | ||||||
|  |             node.renderTitle(); | ||||||
|           } |           } | ||||||
| 
 | 
 | ||||||
|           message("Created!"); |           message("Created!"); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner