mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-12-26 17:09:09 +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");
|
let select = document.getElementById("select");
|
||||||
select.addEventListener("change", function() {
|
select.addEventListener("change", function() {
|
||||||
const input = document.getElementById('source');
|
const input = document.getElementById("source");
|
||||||
|
|
||||||
if (select.value == "file") {
|
if (select.value == "file") {
|
||||||
input.innerHTML = `
|
input.innerHTML = `
|
||||||
Source:
|
Source:
|
||||||
<input type="file" accept="image/*" id="mealImg" name="mealImg">
|
<input type="file" accept="image/*" id="mealImg" name="mealImg">
|
||||||
`
|
`;
|
||||||
}
|
}
|
||||||
//TODO: change to photo taking for sprint 3
|
//TODO: change to photo taking for sprint 3
|
||||||
else {
|
else {
|
||||||
input.innerHTML = `
|
input.innerHTML = `
|
||||||
Source:
|
Source:
|
||||||
<input type="text" id="mealImg" name="mealImg">
|
<input type="text" id="mealImg" name="mealImg">
|
||||||
`
|
`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ function initFormHandler() {
|
|||||||
|
|
||||||
//convert image file into data URL for local storage
|
//convert image file into data URL for local storage
|
||||||
reader.readAsDataURL(document.getElementById("mealImg").files[0]);
|
reader.readAsDataURL(document.getElementById("mealImg").files[0]);
|
||||||
})
|
});
|
||||||
|
|
||||||
form.addEventListener("submit", function(e){
|
form.addEventListener("submit", function(e){
|
||||||
/*
|
/*
|
||||||
|
@ -62,20 +62,20 @@ function setupUpdate(){
|
|||||||
*/
|
*/
|
||||||
let select = document.getElementById("select");
|
let select = document.getElementById("select");
|
||||||
select.addEventListener("change", function() {
|
select.addEventListener("change", function() {
|
||||||
const input = document.getElementById('source');
|
const input = document.getElementById("source");
|
||||||
|
|
||||||
if (select.value == "file") {
|
if (select.value == "file") {
|
||||||
input.innerHTML = `
|
input.innerHTML = `
|
||||||
Source:
|
Source:
|
||||||
<input type="file" accept="image/*" id="mealImg" name="mealImg">
|
<input type="file" accept="image/*" id="mealImg" name="mealImg">
|
||||||
`
|
`;
|
||||||
}
|
}
|
||||||
//TODO: change to photo taking for sprint 3
|
//TODO: change to photo taking for sprint 3
|
||||||
else {
|
else {
|
||||||
input.innerHTML = `
|
input.innerHTML = `
|
||||||
Source:
|
Source:
|
||||||
<input type="text" id="mealImg" name="mealImg">
|
<input type="text" id="mealImg" name="mealImg">
|
||||||
`
|
`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ function setupUpdate(){
|
|||||||
|
|
||||||
//convert image file into data URL for local storage
|
//convert image file into data URL for local storage
|
||||||
reader.readAsDataURL(document.getElementById("mealImg").files[0]);
|
reader.readAsDataURL(document.getElementById("mealImg").files[0]);
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
//Take formdata values as newData when submit
|
//Take formdata values as newData when submit
|
||||||
|
Loading…
Reference in New Issue
Block a user