mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +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) {
|
if(key !== undefined) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
$tw.rootWidget.invokeActionString(action,$tw.rootWidget);
|
$tw.rootWidget.invokeActionString(action,$tw.rootWidget,event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -40,9 +40,10 @@ exports.startup = function() {
|
|||||||
// Install the tm-focus-selector message
|
// Install the tm-focus-selector message
|
||||||
$tw.rootWidget.addEventListener("tm-focus-selector",function(event) {
|
$tw.rootWidget.addEventListener("tm-focus-selector",function(event) {
|
||||||
var selector = event.param || "",
|
var selector = event.param || "",
|
||||||
element;
|
element,
|
||||||
|
doc = event.event ? event.event.target.ownerDocument : document;
|
||||||
try {
|
try {
|
||||||
element = document.querySelector(selector);
|
element = doc.querySelector(selector);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.log("Error in selector: ",selector)
|
console.log("Error in selector: ",selector)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user