Skip to content

Commit

Permalink
Debugging behat scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
senghe committed Sep 5, 2024
1 parent 64a4b3e commit 7d69b12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Resources/assets/admin/js/cms/cms-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export class HandleTemplate {
$.each(data.content, function () {
$('[data-form-collection="add"]').trigger('click');
});
$('textarea').html('<p>' + JSON.stringify(data.content) + '</p>');

const elements = $('[id^="sylius_cms_"][id*="_contentElements_"][id$="_type"]').filter(function() {
return /_page_|_block_/.test(this.id);
Expand All @@ -48,10 +49,10 @@ export class HandleTemplate {
elements.eq(index).val("single_media");
elements.eq(index).change();
} else if (element.type.toString() === "single_media") {
elements.eq(index).val("textarea");
elements.eq(index).val("multiple_media");
elements.eq(index).change();
} else {
elements.eq(index).val("multiple_media");
elements.eq(index).val("spacer");
elements.eq(index).change();
}
});
Expand Down

0 comments on commit 7d69b12

Please sign in to comment.