mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Add test for event.event.target being undefined in the tm-focus-selector listener (#5771)
This commit is contained in:
parent
960160b3a2
commit
f2e26927c1
@ -41,7 +41,7 @@ exports.startup = function() {
|
|||||||
$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;
|
doc = event.event && event.event.target ? event.event.target.ownerDocument : document;
|
||||||
try {
|
try {
|
||||||
element = doc.querySelector(selector);
|
element = doc.querySelector(selector);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user