Skip to content

Commit

Permalink
tiny cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Dcallies committed Apr 24, 2024
1 parent c52b371 commit b339220
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions hasher-matcher-actioner/src/OpenMediaMatch/static/js/match_dbg.js
Expand Up @@ -6,10 +6,12 @@ OMM.match_dbg = {
onFileChange: (id) => {
const form = document.getElementById(id + "-file-upload");
const container = document.getElementById(id + "-img");
const dest_div = document.getElementById(id + "-signals");

if (!('files' in form) || form.files.length !== 1) {
return;
}
dest_div.replaceChildren([]);
const formData = new FormData();
const file = form.files[0];
formData.append("photo", file);
Expand All @@ -19,7 +21,7 @@ OMM.match_dbg = {
const imgUrl = reader.result;
const img = new Image();
img.src = imgUrl;
img.style = "max-width: 256px; max-height: 256px;"
img.style = "max-width: 180px; max-height: 180px;"
container.replaceChildren(img);
};
reader.readAsDataURL(file);
Expand Down Expand Up @@ -58,14 +60,4 @@ OMM.match_dbg = {
navigator.clipboard.writeText(hash_text)
src.toolti
},
displayImgFile: (id) => {
const form = document.getElementById('file-form');
const input = document.getElementById('file-input');
const container = document.getElementById('image-container');

form.addEventListener('submit', (e) => {
e.preventDefault();

});
}
};

0 comments on commit b339220

Please sign in to comment.