Skip to content

Commit

Permalink
Media library image element remove new prop
Browse files Browse the repository at this point in the history
  • Loading branch information
maurofmferrao committed Oct 10, 2023
1 parent 9b5c144 commit 96fabc6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
3 changes: 0 additions & 3 deletions modules/templates/global-elements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,6 @@ $(target).find('.date').each(function(_idx, dateEl){
<canRotate>true</canRotate>
<startWidth>250</startWidth>
<startHeight>250</startHeight>
<properties>
<property id="mediaId" type="text"></property>
</properties>
</template>
<template>
<id>line</id>
Expand Down
9 changes: 0 additions & 9 deletions ui/src/editor-core/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,15 +661,6 @@ Widget.prototype.saveElements = function(
// Save only id and value for element properties if they are not empty
if (element.properties != undefined) {
element.properties = Object.values(element.properties).map((property) => {
// If property is mediaId and it's null, use element mediaId
if (
property.id === 'mediaId' &&
element.mediaId !== undefined &&
property.value === null
) {
property.value = element.mediaId;
}

return {
id: property.id,
value: property.value,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/layout-editor/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ Viewer.prototype.renderElementContent = function(
convertedProperties[extendOverrideKey] = meta[metaKey];
} else if (extendWithDataKey === 'mediaId') {
convertedProperties[extendOverrideKey] =
'[[mediaId=' + convertedProperties[extendWithDataKey] + ']]';
'[[mediaId=' + element.mediaId + ']]';
} else {
convertedProperties[extendOverrideKey] =
(elData) && elData[extendWithDataKey];
Expand Down

0 comments on commit 96fabc6

Please sign in to comment.