From b1843837ea2eecd26a8691d42517f447611bb31c Mon Sep 17 00:00:00 2001 From: Saq Imtiaz Date: Mon, 27 Jan 2025 12:00:26 +0100 Subject: [PATCH] Fixes unnecessary refresh in Genesis widget (#8895) * fix: handle attributes correctly in genesis widget * fix: handle attributes correctly in genesis widget --- core/modules/widgets/genesis.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/modules/widgets/genesis.js b/core/modules/widgets/genesis.js index 299be1e487b..a527553ad29 100644 --- a/core/modules/widgets/genesis.js +++ b/core/modules/widgets/genesis.js @@ -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); };