From 2c59914b74d78ba544d81f5647410ee4d1ea534c Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 10 Jan 2022 09:32:31 -0700 Subject: [PATCH] Fix disabled attribute was not getting properly handled In particular Admin -> File Manager -> VFS mounts and versioning had the "Delete all older versions..." block disabled when it shouldn't have been. --- api/js/etemplate/Et2Widget/Et2Widget.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/api/js/etemplate/Et2Widget/Et2Widget.ts b/api/js/etemplate/Et2Widget/Et2Widget.ts index e93e309f7f..96fe4e042b 100644 --- a/api/js/etemplate/Et2Widget/Et2Widget.ts +++ b/api/js/etemplate/Et2Widget/Et2Widget.ts @@ -199,6 +199,7 @@ const Et2WidgetMixin = (superClass) => { super(...args); + this.disabled = false; this.addEventListener("click", this._handleClick.bind(this)); } @@ -267,14 +268,7 @@ const Et2WidgetMixin = (superClass) => */ set_disabled(value : boolean) { - if(value) - { - this.setAttribute("disabled", "") - } - else - { - this.removeAttribute("disabled"); - } + this.disabled = value; } /** @@ -1188,7 +1182,7 @@ function transformAttributes(widget, mgr : et2_arrayMgr, attributes) } // Set as attribute or property, as appropriate - if(widget.getAttributeNames().indexOf(attribute) >= 0 || property.reflect) + if(widget.getAttributeNames().indexOf(attribute) >= 0/* || property.reflect*/) { // Set as attribute (reflected in DOM) widget.setAttribute(attribute, attrValue);