Przeglądaj źródła

Moved message above the submit button. Added spinner on button click.

Alan Lam 8 lat temu
rodzic
commit
6d9bb06d11
2 zmienionych plików z 6 dodań i 6 usunięć
  1. 4 4
      engine/template.php
  2. 2 2
      public/js/app-test.js

+ 4 - 4
engine/template.php

@@ -35,11 +35,11 @@ class Template extends Model {
 
 			<input type="hidden" name="submit" value="<?=$_SESSION["csrf_token"]?>" />
 
-			<button class="btn btn-primary mt-3" type="submit">Submit Info &amp; Photos</button><br />
+			<span class="text-danger">Please note that it may take a while for photos to upload.</span><br />
 
-			<div class="d-none mt-3" data-submitting-div>
-				<i class="fal fa-fw fa-pulse fa-spinner"></i> Please wait. This may take a while for photos to upload.
-			</div>
+			<button class="btn btn-primary mt-3" type="submit">
+				Submit Info &amp; Photos
+			</button>
 
 		</form>
 		<?php

+ 2 - 2
public/js/app-test.js

@@ -9,7 +9,7 @@ var testStartTime = null;
 function initialiseBeforeTestForm() {
 	$("#before-test-form").on("submit", function() {
 
-		$(this).find("button").attr("disabled", "");
+		$(this).find("button").prepend("<i class=\"fas fa-pulse fa-spinner\"></i> ").attr("disabled", "");
 		$(this).find("div[data-submitting-div]").removeClass("d-none");
 
 	});
@@ -114,7 +114,7 @@ function updateDurationText() {
 
 	var duration = testEndTime - testStartTime;
 	var secs = Math.floor(duration / 1000) % 60;
-	var mins = Math.floor(secs / 60);
+	var mins = Math.floor(duration / 60000);
 
 	$("#test-duration-span").text(mins + " min. " + secs + " sec.");
 }