This adds the ability to move the file data from Utils.displayFilesAsHTML to the input.

This commit is contained in:
bwhitn 2017-07-01 00:40:22 -04:00
parent 213ec028b8
commit 4143bba89f
3 changed files with 18 additions and 0 deletions

View file

@ -158,6 +158,7 @@ Manager.prototype.initialiseEventListeners = function() {
// Misc
document.getElementById("alert-close").addEventListener("click", this.app.alertCloseClick.bind(this.app));
this.addDynamicListener(".file-switch", "click", this.output.fileSwitch, this.output);
};

View file

@ -167,6 +167,16 @@ OutputWaiter.prototype.undoSwitchClick = function() {
document.getElementById("undo-switch").disabled = true;
};
/**
* Handler for file switch click events.
* Moves a files data for items created via Utils.displayFilesAsHTML to the input.
*/
OutputWaiter.prototype.fileSwitch = function(e) {
this.switchOrigData = this.manager.input.get();
this.app.setInput(e.target.getAttribute("fileValue"));
document.getElementById("undo-switch").disabled = false;
};
/**
* Handler for maximise output click events.