mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-11-10 05:34:44 +00:00
fix js linting
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
9c531771f2
commit
12e818e079
@ -22,20 +22,20 @@ function initFormHandler() {
|
||||
*/
|
||||
let select = document.getElementById("select");
|
||||
select.addEventListener("change", function() {
|
||||
const input = document.getElementById('source');
|
||||
const input = document.getElementById("source");
|
||||
|
||||
if (select.value == "file") {
|
||||
input.innerHTML = `
|
||||
Source:
|
||||
<input type="file" accept="image/*" id="mealImg" name="mealImg">
|
||||
`
|
||||
`;
|
||||
}
|
||||
//TODO: change to photo taking for sprint 3
|
||||
else {
|
||||
input.innerHTML = `
|
||||
Source:
|
||||
<input type="text" id="mealImg" name="mealImg">
|
||||
`
|
||||
`;
|
||||
}
|
||||
});
|
||||
|
||||
@ -51,7 +51,7 @@ function initFormHandler() {
|
||||
|
||||
//convert image file into data URL for local storage
|
||||
reader.readAsDataURL(document.getElementById("mealImg").files[0]);
|
||||
})
|
||||
});
|
||||
|
||||
form.addEventListener("submit", function(e){
|
||||
/*
|
||||
|
@ -62,20 +62,20 @@ function setupUpdate(){
|
||||
*/
|
||||
let select = document.getElementById("select");
|
||||
select.addEventListener("change", function() {
|
||||
const input = document.getElementById('source');
|
||||
const input = document.getElementById("source");
|
||||
|
||||
if (select.value == "file") {
|
||||
input.innerHTML = `
|
||||
Source:
|
||||
<input type="file" accept="image/*" id="mealImg" name="mealImg">
|
||||
`
|
||||
`;
|
||||
}
|
||||
//TODO: change to photo taking for sprint 3
|
||||
else {
|
||||
input.innerHTML = `
|
||||
Source:
|
||||
<input type="text" id="mealImg" name="mealImg">
|
||||
`
|
||||
`;
|
||||
}
|
||||
});
|
||||
|
||||
@ -92,7 +92,7 @@ function setupUpdate(){
|
||||
|
||||
//convert image file into data URL for local storage
|
||||
reader.readAsDataURL(document.getElementById("mealImg").files[0]);
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
//Take formdata values as newData when submit
|
||||
|
Loading…
Reference in New Issue
Block a user