mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 07:01:31 +08:00 
			
		
		
		
	feat(geo_map): middle click to open note in new tab
This commit is contained in:
		
							parent
							
								
									0dbd136b48
								
							
						
					
					
						commit
						35207b8df0
					
				@ -12,6 +12,7 @@ import asset_path from "../../../../services/asset_path.js";
 | 
				
			|||||||
import openContextMenu from "./geo_map_context_menu.js";
 | 
					import openContextMenu from "./geo_map_context_menu.js";
 | 
				
			||||||
import link from "../../services/link.js";
 | 
					import link from "../../services/link.js";
 | 
				
			||||||
import note_tooltip from "../../services/note_tooltip.js";
 | 
					import note_tooltip from "../../services/note_tooltip.js";
 | 
				
			||||||
 | 
					import appContext from "../../components/app_context.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const TPL = `\
 | 
					const TPL = `\
 | 
				
			||||||
<div class="note-detail-geo-map note-detail-printable">
 | 
					<div class="note-detail-geo-map note-detail-printable">
 | 
				
			||||||
@ -229,7 +230,15 @@ export default class GeoMapTypeWidget extends TypeWidget {
 | 
				
			|||||||
            .on("moveend", e => {
 | 
					            .on("moveend", e => {
 | 
				
			||||||
                this.moveMarker(note.noteId, (e.target as Marker).getLatLng());
 | 
					                this.moveMarker(note.noteId, (e.target as Marker).getLatLng());
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					        marker.on("mousedown", ({ originalEvent }) => {
 | 
				
			||||||
 | 
					            // Middle click to open in new tab
 | 
				
			||||||
 | 
					            if (originalEvent.button === 1) {
 | 
				
			||||||
 | 
					                const hoistedNoteId = this.hoistedNoteId;
 | 
				
			||||||
 | 
					                //@ts-ignore, fix once tab manager is ported.
 | 
				
			||||||
 | 
					                appContext.tabManager.openInNewTab(note.noteId, hoistedNoteId);
 | 
				
			||||||
 | 
					                return true;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
        marker.on("contextmenu", (e) => {
 | 
					        marker.on("contextmenu", (e) => {
 | 
				
			||||||
            openContextMenu(note.noteId, e.originalEvent);
 | 
					            openContextMenu(note.noteId, e.originalEvent);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user