tab context menu and shortcuts

This commit is contained in:
vcoppe
2024-04-29 17:03:23 +02:00
parent a6bcebf306
commit 49053bcaaa
20 changed files with 409 additions and 24 deletions

View File

@@ -130,13 +130,19 @@ export class RoutingControls {
});
marker.on('dragend', this.moveAnchor.bind(this));
marker.getElement().addEventListener('click', (e) => {
e.stopPropagation();
if (Date.now() - lastDragEvent < 100) { // Prevent click event during drag
return;
}
if (e.shiftKey) {
this.deleteAnchor(anchor);
return;
}
marker.setPopup(this.popup);
marker.togglePopup();
e.stopPropagation();
let deleteThisAnchor = this.getDeleteAnchor(anchor);
this.popupElement.addEventListener('delete', deleteThisAnchor); // Register the delete event for this anchor