Skip to content

Commit

Permalink
Removed roudtripping image data
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Forsgren committed May 12, 2023
1 parent 1f7160c commit 321267d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/controls/editor/editform.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const createForm = function createForm(obj) {
const imageClass = val ? '' : 'o-hidden';
el = `<div class="validate ${cls}"><label>${label}<br>`;
el += `<img src="${val}" id="image-upload" class="${imageClass}"/>`;
el += `<input type="file" name="bildfil" id="${id}" value="${val}" accept="image/*"${disabled}></label>`;
el += `<input type="file" name="bildfil" id="${id}" accept="image/*"${disabled}></label>`;
el += `<input id="o-delete-image-button" class="${imageClass}" type="button" aria-label="Ta bort bild" value="Ta bort bild"${disabled}>`;
el += '</div>';
break;
Expand Down
1 change: 0 additions & 1 deletion src/controls/editor/edithandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,6 @@ function addImageListener() {
// Find the remove button and attach event handler.
document.querySelector(`${containerClass} input[type=button]`).addEventListener('click', (e) => {
// Clear the filename
document.getElementById(obj.elId).setAttribute('value', '');
document.getElementById(obj.elId).value = '';
// Also clear the model value
// eslint-disable-next-line no-param-reassign
Expand Down

0 comments on commit 321267d

Please sign in to comment.