mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	fix opening links with single click outside of the ckeditor instance
This commit is contained in:
		
							parent
							
								
									4d110aa143
								
							
						
					
					
						commit
						51db6761c8
					
				| @ -74,8 +74,12 @@ function goToLink(e) { | |||||||
| 
 | 
 | ||||||
|     const $link = $(e.target).closest("a,.block-link"); |     const $link = $(e.target).closest("a,.block-link"); | ||||||
| 
 | 
 | ||||||
|  |     console.log("zzzzz", $link); | ||||||
|  | 
 | ||||||
|     const notePath = getNotePathFromLink($link); |     const notePath = getNotePathFromLink($link); | ||||||
| 
 | 
 | ||||||
|  |     console.log() | ||||||
|  | 
 | ||||||
|     if (notePath) { |     if (notePath) { | ||||||
|         if ((e.which === 1 && e.ctrlKey) || e.which === 2) { |         if ((e.which === 1 && e.ctrlKey) || e.which === 2) { | ||||||
|             appContext.tabManager.openTabWithNoteWithHoisting(notePath); |             appContext.tabManager.openTabWithNoteWithHoisting(notePath); | ||||||
| @ -88,9 +92,12 @@ function goToLink(e) { | |||||||
|     else { |     else { | ||||||
|         if ((e.which === 1 && e.ctrlKey) || e.which === 2 |         if ((e.which === 1 && e.ctrlKey) || e.which === 2 | ||||||
|             || $link.hasClass("ck-link-actions__preview") // within edit link dialog single click suffices
 |             || $link.hasClass("ck-link-actions__preview") // within edit link dialog single click suffices
 | ||||||
|  |             || $link.closest("[contenteditable]").length === 0 // outside of CKEditor single click suffices
 | ||||||
|         ) { |         ) { | ||||||
|             const address = $link.attr('href'); |             const address = $link.attr('href'); | ||||||
| 
 | 
 | ||||||
|  |             console.log("address", address); | ||||||
|  | 
 | ||||||
|             if (address) { |             if (address) { | ||||||
|                 if (address.toLowerCase().startsWith('http')) { |                 if (address.toLowerCase().startsWith('http')) { | ||||||
|                     window.open(address, '_blank'); |                     window.open(address, '_blank'); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam