1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Ensure new variables are strings (#5197)

This commit is contained in:
Saq Imtiaz 2020-12-04 20:02:05 +01:00 committed by GitHub
parent 8799911162
commit 9825b5b4a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,13 +97,13 @@ EventWidget.prototype.render = function(parent,nextSibling) {
variables["event-mousebutton"] = "right";
}
}
variables["event-type"] = event.type;
variables["event-type"] = event.type.toString();
if(typeof event.detail === "object" && !!event.detail) {
$tw.utils.each(event.detail,function(detailValue,detail) {
variables["event-detail-" + detail] = detailValue;
variables["event-detail-" + detail] = detailValue.toString();
});
} else if(!!event.detail) {
variables["event-detail"] = event.detail;
variables["event-detail"] = event.detail.toString();
}
self.invokeActionString(actions,self,event,variables);
event.preventDefault();
@ -153,4 +153,4 @@ EventWidget.prototype.refresh = function(changedTiddlers) {
exports.eventcatcher = EventWidget;
})();
})();