mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
* Pass the original event to invokeActionString * Update rootwidget.js
This commit is contained in:
parent
2f1806ab6a
commit
c18b7527a7
@ -324,7 +324,7 @@ KeyboardManager.prototype.handleKeydownEvent = function(event) {
|
||||
if(key !== undefined) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$tw.rootWidget.invokeActionString(action,$tw.rootWidget);
|
||||
$tw.rootWidget.invokeActionString(action,$tw.rootWidget,event);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -40,9 +40,10 @@ exports.startup = function() {
|
||||
// Install the tm-focus-selector message
|
||||
$tw.rootWidget.addEventListener("tm-focus-selector",function(event) {
|
||||
var selector = event.param || "",
|
||||
element;
|
||||
element,
|
||||
doc = event.event ? event.event.target.ownerDocument : document;
|
||||
try {
|
||||
element = document.querySelector(selector);
|
||||
element = doc.querySelector(selector);
|
||||
} catch(e) {
|
||||
console.log("Error in selector: ",selector)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user