Only enable save button when DLL loaded

This commit is contained in:
William Toohey
2017-03-05 17:23:05 +10:00
parent 5121ed3fcf
commit 49efe933b3
+6 -2
View File
@@ -184,9 +184,10 @@ DllPatcher.prototype.createUI = function() {
this.errorDiv = $("<div>", {"class": "error"}); this.errorDiv = $("<div>", {"class": "error"});
this.patchDiv = $("<div>", {"class": "patches"}); this.patchDiv = $("<div>", {"class": "patches"});
var saveButton = $("<button>"); var saveButton = $("<button disabled>");
saveButton.text('Save DLL'); saveButton.text('Load DLL First');
saveButton.on('click', this.saveDll.bind(this)); saveButton.on('click', this.saveDll.bind(this));
this.saveButton = saveButton;
container.append(this.fileInput); container.append(this.fileInput);
container.append(label); container.append(label);
@@ -209,6 +210,9 @@ DllPatcher.prototype.loadFile = function(file) {
} else { } else {
self.successDiv.addClass("hidden"); self.successDiv.addClass("hidden");
} }
// Update save button regardless
self.saveButton.prop('disabled', false);
self.saveButton.text('Save DLL');
self.errorDiv.html(self.errorLog); self.errorDiv.html(self.errorLog);
self.updatePatchUI(); self.updatePatchUI();
}; };