fix game data bugs; tidyup

This commit is contained in:
Max Bradbury 2020-07-19 22:02:22 +01:00
parent e7641255e5
commit d32ad0d27d
1 changed files with 5 additions and 4 deletions

View File

@ -41,7 +41,7 @@ async function run() {
} }
function clear_game() { function clear_game() {
gameDataInput.innerHTML = ""; gameDataInput.value = "";
} }
let new_game_button = document.getElementById("new"); let new_game_button = document.getElementById("new");
@ -96,9 +96,10 @@ async function run() {
function addTiles() { function addTiles() {
let image = document.getElementById("preview").getAttribute("src"); let image = document.getElementById("preview").getAttribute("src");
let gameData = document.getElementById("game-data").innerHTML; let gameData = document.getElementById("game-data").value;
let prefix = document.getElementById("prefix").value; let prefix = document.getElementById("prefix").value;
document.getElementById("output").innerHTML = add_tiles(gameData, image, prefix);
output.value = add_tiles(gameData, image, prefix);
} }
const importButton = document.getElementById("import"); const importButton = document.getElementById("import");
@ -116,7 +117,7 @@ async function run() {
addImageButton.addEventListener("touchend", addImage); addImageButton.addEventListener("touchend", addImage);
function reset() { function reset() {
gameDataInput.innerHTML = ''; clear_game();
preview.removeAttribute("src"); preview.removeAttribute("src");
} }