Skip to content

Commit

Permalink
fixup! fixup! Feat(web-twig): FileUploader - Support for crop image #…
Browse files Browse the repository at this point in the history
…DS-954
  • Loading branch information
pavelklibani committed Oct 18, 2023
1 parent a12120f commit ff3e684
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/web-twig-demo/assets/scripts/file-uploader-meta-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ window.addEventListener('DOMContentLoaded', () => {
const fileName = FileUploaderInstance.getUpdatedFileName(file.name);
const metaInput = attachmentElement?.querySelector(`input[name="attachments_${fileName}_meta"]`);

// if we have meta data update input if exist OR create new one if not exist
// If we have metadata, we check if the input exists and if so we update its value else we create a new one
if (meta) {
if (metaInput) {
metaInput.value = JSON.stringify(meta);
Expand All @@ -33,7 +33,7 @@ window.addEventListener('DOMContentLoaded', () => {
}
}

// remove input if exist AND we have no meta data
// If we do not have metadata, we remove the input
if (!meta) {
metaInput && metaInput.remove();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
const moduleFunctions = {};
</script>

{{ encore_entry_script_tags('fileUploaderMetaData') }}
{{ encore_entry_script_tags('fileUploaderMetaData') }}

0 comments on commit ff3e684

Please sign in to comment.