Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(geo_map): middle click to open note in new tab
Elian Doran35207b8df0e4
diff --git a/src/public/app/widgets/type_widgets/geo_map.ts b/src/public/app/widgets/type_widgets/geo_map.tsindex fdca64cbce..11de0b2b35 100644--- a/src/public/app/widgets/type_widgets/geo_map.ts+++ b/src/public/app/widgets/type_widgets/geo_map.ts@@ -12,6 +12,7 @@ import asset_path from "../../../../services/asset_path.js";import openContextMenu from "./geo_map_context_menu.js";import link from "../../services/link.js";import note_tooltip from "../../services/note_tooltip.js";+import appContext from "../../components/app_context.js";const TPL = `\<div class="note-detail-geo-map note-detail-printable">@@ -229,7 +230,15 @@ export default class GeoMapTypeWidget extends TypeWidget {.on("moveend", e => {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) => {openContextMenu(note.noteId, e.originalEvent);});