From c840b97a36308d24f3aba84ee413481c844b0a51 Mon Sep 17 00:00:00 2001 From: saqimtiaz Date: Fri, 17 Jan 2025 12:12:38 +0100 Subject: [PATCH 1/2] fix: handle attributes correctly in genesis widget --- core/modules/widgets/genesis.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/modules/widgets/genesis.js b/core/modules/widgets/genesis.js index 299be1e487b..42b2a48338b 100644 --- a/core/modules/widgets/genesis.js +++ b/core/modules/widgets/genesis.js @@ -23,6 +23,15 @@ 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 */ From 00cf512d8fa17bad4cdc5f2146534d7acb717cbd Mon Sep 17 00:00:00 2001 From: saqimtiaz Date: Fri, 17 Jan 2025 12:13:49 +0100 Subject: [PATCH 2/2] fix: handle attributes correctly in genesis widget --- core/modules/widgets/genesis.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/modules/widgets/genesis.js b/core/modules/widgets/genesis.js index 42b2a48338b..a527553ad29 100644 --- a/core/modules/widgets/genesis.js +++ b/core/modules/widgets/genesis.js @@ -37,10 +37,7 @@ 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); };