1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-01 16: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:
Simon Huber
2021-01-09 14:25:48 +01:00
committed by GitHub
parent b632cea6b7
commit 4858b24cfe
7 changed files with 53 additions and 53 deletions

View File

@@ -16,12 +16,6 @@ var Widget = require("$:/core/modules/widgets/widget.js").widget;
var FieldManglerWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
this.addEventListeners([
{type: "tm-remove-field", handler: "handleRemoveFieldEvent"},
{type: "tm-add-field", handler: "handleAddFieldEvent"},
{type: "tm-remove-tag", handler: "handleRemoveTagEvent"},
{type: "tm-add-tag", handler: "handleAddTagEvent"}
]);
};
/*
@@ -33,6 +27,12 @@ FieldManglerWidget.prototype = new Widget();
Render this widget into the DOM
*/
FieldManglerWidget.prototype.render = function(parent,nextSibling) {
this.addEventListeners([
{type: "tm-remove-field", handler: "handleRemoveFieldEvent"},
{type: "tm-add-field", handler: "handleAddFieldEvent"},
{type: "tm-remove-tag", handler: "handleRemoveTagEvent"},
{type: "tm-add-tag", handler: "handleAddTagEvent"}
]);
this.parentDomNode = parent;
this.computeAttributes();
this.execute();