Skip to content

Commit

Permalink
Weather Widget: Fix elements preview positioning with defaultScaler f…
Browse files Browse the repository at this point in the history
…unction (#2178)

relates to xibosignage/xibo#3196
  • Loading branch information
rubenpingol-xibo committed Oct 23, 2023
1 parent e62f418 commit 21c364d
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions modules/src/player.js
Expand Up @@ -270,6 +270,7 @@ $(function() {
url,
meta,
} = widget;
widget.items = [];

if (Object.keys(elements.groups).length > 0 ||
Object.keys(elements.standalone).length > 0) {
Expand Down Expand Up @@ -384,16 +385,11 @@ $(function() {
if (typeof window[
`onElementParseData_${item.templateData.id}`
] === 'function') {
const onElementParseData = window[
`onElementParseData_${item.templateData.id}`
];

if (onElementParseData) {
dataItem[item.dataOverride] = onElementParseData(
dataItem[item.dataOverride] =
window[`onElementParseData_${item.templateData.id}`](
dataItem[extendDataWith],
{...item.templateData, data: dataItem},
);
}
}

let groupItemStyles = {
Expand Down Expand Up @@ -592,6 +588,8 @@ $(function() {
$grpContent.find(`.${groupSlotObj.id}--item`),
);
});

widget.items.push($grpContent);
}
});
}
Expand Down Expand Up @@ -693,6 +691,8 @@ $(function() {
},
$grpItem.find(`.${grpCln}--item`),
);

widget.items.push($grpItem);
}
});
} else {
Expand All @@ -715,6 +715,19 @@ $(function() {
}
});
}

// Run defaultScaler for elements
defaultScaler(
widget.widgetId,
$content,
widget.items,
Object.assign(
widget.properties,
globalOptions,
{duration: widget.duration},
),
meta,
);
}
}

Expand Down

0 comments on commit 21c364d

Please sign in to comment.