Home WIP: Fix changing portlet width would not stick for some types

This commit is contained in:
nathan 2023-03-07 16:16:01 -07:00
parent d9e12ecf4a
commit 9f95db7ad8

View File

@ -180,7 +180,21 @@ export class Et2Portlet extends Et2Widget(SlCard)
*/ */
transformAttributes(attrs) transformAttributes(attrs)
{ {
// Pull out width - super will handle it wrong then remove it
let width
if(typeof attrs.width != "undefined")
{
width = attrs.width;
delete attrs.width;
}
super.transformAttributes(attrs); super.transformAttributes(attrs);
// If width was provided, put it back
if(typeof width != "undefined")
{
attrs.width = width;
}
let data = this.getArrayMgr("content").data.find(e => e.id && e.id == this.id) || {}; let data = this.getArrayMgr("content").data.find(e => e.id && e.id == this.id) || {};
this.settings = typeof attrs.settings == "string" ? data.value || data.settings || {} : attrs.settings; this.settings = typeof attrs.settings == "string" ? data.value || data.settings || {} : attrs.settings;