mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	hide "go to selected note" button in jump because it doesn't make sense there
This commit is contained in:
		
							parent
							
								
									24a0856d22
								
							
						
					
					
						commit
						e44c7c9947
					
				| @ -15,15 +15,13 @@ async function showDialog() { | |||||||
| 
 | 
 | ||||||
|     $dialog.modal(); |     $dialog.modal(); | ||||||
| 
 | 
 | ||||||
|     noteAutocompleteService.initNoteAutocomplete($autoComplete) |     noteAutocompleteService.initNoteAutocomplete($autoComplete, { hideGoToSelectedNoteButton: true }) | ||||||
|         .on('autocomplete:selected', function(event, suggestion, dataset) { |         .on('autocomplete:selected', function(event, suggestion, dataset) { | ||||||
|             if (!suggestion.path) { |             if (!suggestion.path) { | ||||||
|                 return false; |                 return false; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             treeService.activateNote(suggestion.path); |             treeService.activateNote(suggestion.path); | ||||||
| 
 |  | ||||||
|             $dialog.modal('hide'); |  | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|     noteAutocompleteService.showRecentNotes($autoComplete); |     noteAutocompleteService.showRecentNotes($autoComplete); | ||||||
|  | |||||||
| @ -30,8 +30,10 @@ function showRecentNotes($el) { | |||||||
|     $el.autocomplete("open"); |     $el.autocomplete("open"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function initNoteAutocomplete($el) { | function initNoteAutocomplete($el, options) { | ||||||
|     if (!$el.hasClass("note-autocomplete-input")) { |     if (!$el.hasClass("note-autocomplete-input")) { | ||||||
|  |         options = options || {}; | ||||||
|  | 
 | ||||||
|         $el.addClass("note-autocomplete-input"); |         $el.addClass("note-autocomplete-input"); | ||||||
| 
 | 
 | ||||||
|         const $clearTextButton = $("<span>") |         const $clearTextButton = $("<span>") | ||||||
| @ -46,11 +48,16 @@ function initNoteAutocomplete($el) { | |||||||
|             .addClass("input-group-text go-to-selected-note-button jam jam-arrow-right") |             .addClass("input-group-text go-to-selected-note-button jam jam-arrow-right") | ||||||
|             .prop("title", "Go to selected note"); |             .prop("title", "Go to selected note"); | ||||||
| 
 | 
 | ||||||
|         $el.after($("<div>") |         const $sideButtons = $("<div>") | ||||||
|             .addClass("input-group-append") |             .addClass("input-group-append") | ||||||
|             .append($clearTextButton) |             .append($clearTextButton) | ||||||
|             .append($showRecentNotesButton) |             .append($showRecentNotesButton); | ||||||
|             .append($goToSelectedNoteButton)); | 
 | ||||||
|  |         if (!options.hideGoToSelectedNoteButton) { | ||||||
|  |             $sideButtons.append($goToSelectedNoteButton); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         $el.after($sideButtons); | ||||||
| 
 | 
 | ||||||
|         $clearTextButton.click(() => clearText($el)); |         $clearTextButton.click(() => clearText($el)); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner