mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	mini refactoring
This commit is contained in:
		
							parent
							
								
									21a96d2776
								
							
						
					
					
						commit
						d31a136442
					
				| @ -16,7 +16,7 @@ async function showDialog() { | |||||||
| 
 | 
 | ||||||
|     const result = await server.get('event-log'); |     const result = await server.get('event-log'); | ||||||
| 
 | 
 | ||||||
|     $list.html(''); |     $list.empty(); | ||||||
| 
 | 
 | ||||||
|     for (const event of result) { |     for (const event of result) { | ||||||
|         const dateTime = utils.formatDateTime(utils.parseDate(event.dateCreated)); |         const dateTime = utils.formatDateTime(utils.parseDate(event.dateCreated)); | ||||||
|  | |||||||
| @ -119,11 +119,9 @@ async function saveNoteIfChanged() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function setNoteBackgroundIfProtected(note) { | function setNoteBackgroundIfProtected(note) { | ||||||
|     const isProtected = note.isProtected; |     $noteDetailWrapper.toggleClass("protected", note.isProtected); | ||||||
| 
 |     $protectButton.toggleClass("active", note.isProtected); | ||||||
|     $noteDetailWrapper.toggleClass("protected", isProtected); |     $unprotectButton.toggleClass("active", !note.isProtected); | ||||||
|     $protectButton.toggleClass("active", isProtected); |  | ||||||
|     $unprotectButton.toggleClass("active", !isProtected); |  | ||||||
|     $unprotectButton.prop("disabled", !protectedSessionHolder.isProtectedSessionAvailable()); |     $unprotectButton.prop("disabled", !protectedSessionHolder.isProtectedSessionAvailable()); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -183,7 +181,7 @@ async function loadNoteDetail(noteId) { | |||||||
|     // after loading new note make sure editor is scrolled to the top
 |     // after loading new note make sure editor is scrolled to the top
 | ||||||
|     $noteDetailWrapper.scrollTop(0); |     $noteDetailWrapper.scrollTop(0); | ||||||
| 
 | 
 | ||||||
|     $scriptArea.html(''); |     $scriptArea.empty(); | ||||||
| 
 | 
 | ||||||
|     await bundleService.executeRelationBundles(getCurrentNote(), 'runOnNoteView'); |     await bundleService.executeRelationBundles(getCurrentNote(), 'runOnNoteView'); | ||||||
| 
 | 
 | ||||||
| @ -417,7 +415,7 @@ async function loadAttributes() { | |||||||
|         $promotedAttributesContainer.empty().append($tbody); |         $promotedAttributesContainer.empty().append($tbody); | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|         $attributeListInner.html(''); |         $attributeListInner.empty(); | ||||||
| 
 | 
 | ||||||
|         if (attributes.length > 0) { |         if (attributes.length > 0) { | ||||||
|             for (const attribute of attributes) { |             for (const attribute of attributes) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner