1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-06 22:20:02 +00:00

Fixes unnecessary refresh in Genesis widget (#8895)

* fix: handle attributes correctly in genesis widget

* fix: handle attributes correctly in genesis widget
This commit is contained in:
Saq Imtiaz 2025-01-27 12:00:26 +01:00 committed by GitHub
parent 42c22acba6
commit b1843837ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,15 +23,21 @@ Inherit from the base widget class
*/
GenesisWidget.prototype = new Widget();
GenesisWidget.prototype.computeAttributes = function(options) {
options = options || Object.create(null);
options.filterFn = function(name) {
// Only compute our own attributes which start with a single dollar
return name.charAt(0) === "$" && name.charAt(1) !== "$";
}
return Widget.prototype.computeAttributes.call(this,options);
};
/*
Render this widget into the DOM
*/
GenesisWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes({filterFn: function(name) {
// Only compute our own attributes which start with a single dollar
return name.charAt(0) === "$" && name.charAt(1) !== "$";
}});
this.computeAttributes();
this.execute();
this.renderChildren(parent,nextSibling);
};