mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Enhance links so that control/command clicking suppresses navigation
Control- or Command-clicking on a link will now open the target tiddler but suppress navigating to it. Kind of like opening in a background tab.
This commit is contained in:
parent
523eae83ff
commit
470beabf17
@ -94,7 +94,8 @@ LinkWidget.prototype.handleClickEvent = function (event) {
|
||||
navigateFromTitle: this.getVariable("storyTiddler"),
|
||||
navigateFromNode: this,
|
||||
navigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height
|
||||
}
|
||||
},
|
||||
navigateSuppressNavigation: event.metaKey || event.ctrlKey
|
||||
});
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
@ -149,7 +149,9 @@ Handle a tw-navigate event
|
||||
*/
|
||||
NavigatorWidget.prototype.handleNavigateEvent = function(event) {
|
||||
this.addToStory(event.navigateTo,event.navigateFromTitle);
|
||||
if(!event.navigateSuppressNavigation) {
|
||||
this.addToHistory(event.navigateTo,event.navigateFromClientRect);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user