Commit c6f9c1a7 authored by Armand Bour's avatar Armand Bour Committed by Mikaël Salson
Browse files

Add export fasta button (bug)

parent c7b7a6bb
......@@ -31,6 +31,7 @@
<p>or</p>
<input id="form_sequences_file" name="sequences_file" type="file" />
<input id="form_submit" type="button" value="Submit" />
<button id="btn_exportfasta" class="btn_feature">Export to FASTA</button>
</div>
</form>
<p id="copyright">Copyright Vidjil © 2016</p>
......
......@@ -143,13 +143,36 @@ function displayWaitingForCallback(waiting) {
/**
* Enables or disables the submit button.
* @param {bool} disabled - 'true' to enable, 'false' to disable.
* @param {bool} disabled - 'true' to disable, 'false' to enable.
*/
function disableSubmitButt(disabled) {
var submitButt = document.getElementById('form_submit');
submitButt.disabled = disabled;
}
/**
* Enables or disables the feature buttons.
* @param {bool} disabled - 'true' to disable, 'false' to enable.
*/
function disableFeatures(disabled) {
var featuresBtn = document.getElementsByClassName('btn_feature');
for (var i = 0; i < featuresBtn.length; i++) {
featuresBtn[i].disabled = disabled;
}
}
/**
* Prepares the button listeners.
*/
function prepareButtons() {
var exportFastaBtn = document.getElementById('btn_exportfasta');
exportFastaBtn.addEventListener('click', function () {
model.exportFasta();
});
}
/**
* Removes all children from Vidjil views.
*/
......@@ -177,6 +200,9 @@ function main() {
console = new Com(window.console);
setCrossDomainModel(model);
prepareButtons();
disableFeatures(true);
// Parse sequences and add to segmenter
// displayVidjilViews(false);
submitNode.addEventListener('click', function () {
......@@ -205,6 +231,7 @@ function main() {
addPrefixedEvent(segContainer, 'TransitionEnd', funct);
displayWaitingForCallback(false);
disableSubmitButt(false);
disableFeatures(false);
},
function (xhr, textStatus, exc) { // On error return
displayError('We had a problem processing your request.', textStatus, exc);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment