Skip to content

Commit

Permalink
Fixes unnecessary refresh in Genesis widget (#8895)
Browse files Browse the repository at this point in the history
* fix: handle attributes correctly in genesis widget

* fix: handle attributes correctly in genesis widget
  • Loading branch information
saqimtiaz authored Jan 27, 2025
1 parent 42c22ac commit b184383
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions core/modules/widgets/genesis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit b184383

Please sign in to comment.