mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-30 15:13:00 +00:00
Fix #5308 - WidgetSubclassingMechanism not working with widgets that add EventListeners (or logic ?) in constructor (#5382)
* add EventListeners in the render() method instead of the constructor * scrollable widget: add EventListeners in render() method instead of constructor + ... move logic from constructor to render() * linkcatcher: add EventListeners in render() instead of constructor * fieldmangler: add EventListeners in render() instead of constructor * edit-bitmap: initialise editorOperations in render() instead of constructor * list-widget: initialise storyviews in render() instead of constructor * vars widget: execute Widget.call(this) in render() instead of constructor ... not shure what this should do * Update fieldmangler.js * Update edit-bitmap.js * Update linkcatcher.js * Update navigator.js * Update scrollable.js * Update list.js * Update vars.js
This commit is contained in:
@@ -16,9 +16,6 @@ var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||
|
||||
var LinkCatcherWidget = function(parseTreeNode,options) {
|
||||
this.initialise(parseTreeNode,options);
|
||||
this.addEventListeners([
|
||||
{type: "tm-navigate", handler: "handleNavigateEvent"}
|
||||
]);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -30,6 +27,9 @@ LinkCatcherWidget.prototype = new Widget();
|
||||
Render this widget into the DOM
|
||||
*/
|
||||
LinkCatcherWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.addEventListeners([
|
||||
{type: "tm-navigate", handler: "handleNavigateEvent"}
|
||||
]);
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
|
||||
Reference in New Issue
Block a user