Add modifier variable to linkcatcher actionstring (#4758)

* Add modifier variable to linkcatcher actionstring

* Update LinkCatcherWidget.tid
optimising-macrocalls
Simon Huber 2020-07-15 13:27:14 +02:00 zatwierdzone przez GitHub
rodzic 484c9e986f
commit 95e30138f0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -87,7 +87,8 @@ LinkCatcherWidget.prototype.handleNavigateEvent = function(event) {
}
if(this.catchActions) {
this.executingActions = true;
this.invokeActionString(this.catchActions,this,event,{navigateTo: event.navigateTo});
var modifierKey = $tw.keyboardManager.getEventModifierKeyDescriptor(event);
this.invokeActionString(this.catchActions,this,event,{navigateTo: event.navigateTo, modifier: modifierKey});
this.executingActions = false;
}
} else {

Wyświetl plik

@ -23,5 +23,5 @@ The content of the `<$linkcatcher>` widget is displayed normally.
|message |Optional identifier for a [[widget message|Messages]] to be sent when a navigation is caught |
|set |Optional title of the tiddler to be set to a specified value when navigation occurs |
|setTo |Value to be assigned by the `set` attribute |
|actions |Actions to be performed when a link is caught. Within the action string, the variable "navigateTo" contains the title of the tiddler being navigated |
|actions |Actions to be performed when a link is caught. Within the action string, the variable "navigateTo" contains the title of the tiddler being navigated. <<.from-version "5.1.23">> the <<.def "modifier">> variable lists the modifier keys that are pressed when the action is invoked. The possible modifiers are ''ctrl'', ''ctrl-alt'', ''ctrl-shift'', ''alt'', ''alt-shift'', ''shift'' and ''ctrl-alt-shift'' |