Skip to content

Commit

Permalink
fix enable/disable logic for the "Save Mission" button
Browse files Browse the repository at this point in the history
  • Loading branch information
jboecker committed Mar 9, 2014
1 parent 183c7b0 commit 7cc1f78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/admintool.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ $(function() {
$("#connect_existing_form").submit(function(e) {
e.preventDefault();
$("#save-file-input-td").append($("#file-input").remove());
$("#file-input").off("click");
$("#file-input").change(function() {
set_status("hashing file...");
var fr = new FileReader();
Expand All @@ -118,11 +119,12 @@ $(function() {
md5hash = spark.end();
set_status("");
$(".filename-h2").text(document.getElementById("file-input").files[0].name);
$("#save-mission-button").attr("disabled", true);
$("#save-mission-button").removeAttr("disabled");
}
$("#save-mission-button").removeAttr("disabled");
$("#save-mission-button").attr("disabled", true);
fr.readAsArrayBuffer(document.getElementById("file-input").files[0]);
});
if (!document.getElementById("file-input").files.length) $("#save-mission-button").attr("disabled", true);

$("#connect_existing_step1").hide();
ADMIN_URI = new URI($("#admin-url-input").val());
Expand Down

0 comments on commit 7cc1f78

Please sign in to comment.