1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 00:50:28 +00:00

Update the transclude widget to update parameters for remove tag message

This commit is contained in:
Jeremy Ruston 2013-06-09 19:27:15 +01:00
parent d4b6c05bc2
commit e4aa80b277

View File

@ -108,17 +108,23 @@ TranscludeWidget.prototype.generate = function() {
tiddlerTitle: this.targetTitle,
templateTitle: this.templateTitle
};
// Initialise events
this.events = [];
// If a current field is specified
if(this.currentField) {
// Record the current field in the render context
this.renderer.context.field = this.currentField;
// Add an event handler to record the current field
var addCurrentField = function(event) {
this.events.push({name: "tw-remove-field", handlerFunction: function(event) {
event.currentField = self.currentField;
return true;
}
this.events = [{name: "tw-remove-field", handlerFunction: addCurrentField}];
}});
}
// Trap and update tag modification events
this.events.push({name: "tw-remove-tag", handlerFunction: function(event) {
event.currentTag = self.targetTitle;
return true;
}});
// Set the element
this.tag = this.renderer.parseTreeNode.isBlock ? "div" : "span";
this.attributes = {};