commit 06df44551af42bcb18a4b45b924316d91637b8e8 parent eaeea9f0d2121012ec4815818883c055b8605c2d Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com> Date: Fri, 15 May 2020 08:54:39 -0700 Implement loading message while loading lyrics. Diffstat:
| M | Songs2Slides/static/index.js | | | 11 | +++++++---- |
| M | Songs2Slides/templates/index.html | | | 2 | +- |
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/Songs2Slides/static/index.js b/Songs2Slides/static/index.js @@ -188,6 +188,12 @@ async function SubmitSongs() { // Get the parsed lyrics for the user to review async function ReviewLyrics() { + // Show and hide elements + document.getElementById("lyrics").value = "Loading lyrics..."; + document.getElementById("lyrics").readOnly = true; + document.getElementById("songsContainer").hidden = true; + document.getElementById("lyricsContainer").hidden = false; + // Get songs songs = getSongs(); @@ -203,10 +209,7 @@ async function ReviewLyrics() { // Set lyrics document.getElementById("lyrics").value = json["lyrics"].join("\n\n") - - // Show and hide elements - document.getElementById("songsContainer").hidden = true; - document.getElementById("lyricsContainer").hidden = false; + document.getElementById("lyrics").readOnly = false; } diff --git a/Songs2Slides/templates/index.html b/Songs2Slides/templates/index.html @@ -39,7 +39,7 @@ <p>Review and edit the parsed lyrics below and then click the create PowerPoint button. One blank line represents the start of a new slide and three blank lines represent a blank slide.</p> - <textarea rows="15" id="lyrics">Loading lyrics...</textarea> + <textarea rows="15" id="lyrics"></textarea> <div id="lyricsButtons"> <a id="lyricsBack" href="javascript:Back()">Back</a>