1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-29 15:30:47 +00:00

Allow macros to specify capturing event handlers

This commit is contained in:
Jeremy Ruston 2012-06-13 15:36:16 +01:00
parent 28fd037c47
commit c168ec0ad4

View File

@ -187,7 +187,11 @@ Macro.prototype.addEventHandlers = function() {
if(this.info.events && this.child) {
for(var t=0; t<this.info.events.length; t++) {
// Register this macro node to handle the event via the handleEvent() method
this.child.domNode.addEventListener(this.info.events[t],this,false);
var info = this.info.events[t];
if(typeof info === "string") {
info = {type: info};
}
this.child.domNode.addEventListener(info.type,this,info.capture);
}
}
};