kopia lustrzana https://github.com/miklobit/TiddlyWiki5
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.print-window-tiddler
rodzic
523eae83ff
commit
470beabf17
|
@ -94,7 +94,8 @@ LinkWidget.prototype.handleClickEvent = function (event) {
|
||||||
navigateFromTitle: this.getVariable("storyTiddler"),
|
navigateFromTitle: this.getVariable("storyTiddler"),
|
||||||
navigateFromNode: this,
|
navigateFromNode: this,
|
||||||
navigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height
|
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.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
|
@ -149,7 +149,9 @@ Handle a tw-navigate event
|
||||||
*/
|
*/
|
||||||
NavigatorWidget.prototype.handleNavigateEvent = function(event) {
|
NavigatorWidget.prototype.handleNavigateEvent = function(event) {
|
||||||
this.addToStory(event.navigateTo,event.navigateFromTitle);
|
this.addToStory(event.navigateTo,event.navigateFromTitle);
|
||||||
this.addToHistory(event.navigateTo,event.navigateFromClientRect);
|
if(!event.navigateSuppressNavigation) {
|
||||||
|
this.addToHistory(event.navigateTo,event.navigateFromClientRect);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue