Skip to content

Commit

Permalink
Layout Editor: you can't upload an image into an image placeholder (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
maurofmferrao authored Oct 2, 2024
1 parent 8d78e5f commit fdff166
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
9 changes: 7 additions & 2 deletions ui/src/editor-core/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1621,8 +1621,13 @@ Toolbar.prototype.handleDroppables = function(draggable, customClasses = '') {

// Image placeholder
if (
$(draggable).data('type') === 'media' &&
$(draggable).data('subType') === 'image'
(
$(draggable).data('type') === 'media' &&
$(draggable).data('subType') === 'image'
) || (
$(draggable).data('type') === 'widget' &&
$(draggable).data('subType') === 'image'
)
) {
selectorBuild.push(
'.designer-element[data-sub-type="image_placeholder"]',
Expand Down
3 changes: 3 additions & 0 deletions ui/src/layout-editor/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,9 @@ lD.selectObject =
(
$(card).data('type') === 'media' &&
$(card).data('subType') === 'image'
) || (
$(card).data('type') === 'widget' &&
$(card).data('subType') === 'image'
)
);

Expand Down
9 changes: 7 additions & 2 deletions ui/src/layout-editor/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,13 @@ Viewer.prototype.handleInteractions = function() {
tolerance: 'pointer',
accept: (draggable) => {
return (
$(draggable).data('type') === 'media' &&
$(draggable).data('subType') === 'image'
(
$(draggable).data('type') === 'media' &&
$(draggable).data('subType') === 'image'
) || (
$(draggable).data('type') === 'widget' &&
$(draggable).data('subType') === 'image'
)
);
},
drop: _.debounce(function(event, ui) {
Expand Down

0 comments on commit fdff166

Please sign in to comment.