public/js/report.js in sequenceserver-2.0.0.beta1 vs public/js/report.js in sequenceserver-2.0.0.beta3

- old
+ new

@@ -110,26 +110,18 @@ poll(); }, /** - * Incrementally update state so that the rendering process is - * not overwhelemed when there are too many queries. + * Incrementally update state (50 queries at a time) so that the rendering + * process is not overwhelemed when there are too many queries. */ updateState: function(responseJSON) { var queries = responseJSON.queries; - - // Render results for first 50 queries and set flag if total queries is - // more than 250. - var numHits = 0; + responseJSON.num_queries = queries.length; responseJSON.veryBig = queries.length > 250; - //responseJSON.veryBig = !_.every(queries, (query) => { - //numHits += query.hits.length; - //return (numHits <= 500); - //}); responseJSON.queries = queries.splice(0, 50); - responseJSON.num_queries = queries.length; this.setState(responseJSON); // Render results for remaining queries. var update = function () { if (queries.length > 0) { @@ -305,14 +297,10 @@ // results DOM. if (this.updateCycle === 1 ) this.affixSidebar(); }, /** - * Prevents folding of hits during text-selection, etc. - */ - - /** * Called after all results have been rendered. */ componentFinishedUpdating: function () { this.shouldShowIndex() && this.setupScrollSpy(); }, @@ -924,10 +912,11 @@ var sequence_ids = $('.hit-links :checkbox').map(function () { return this.value; }).get(); var database_ids = _.map(this.props.data.querydb, _.iteratee('id')); downloadFASTA(sequence_ids, database_ids); + return false; }, /** * Handles downloading fasta of selected hits. */ @@ -935,10 +924,11 @@ var sequence_ids = $('.hit-links :checkbox:checked').map(function () { return this.value; }).get(); var database_ids = _.map(this.props.data.querydb, _.iteratee('id')); downloadFASTA(sequence_ids, database_ids); + return false; }, downloadAlignmentOfAll: function() { var sequence_ids = $('.hit-links :checkbox').map(function () { return this.value; @@ -954,10 +944,11 @@ }) }) }, this)); console.log('len '+hsps_arr.length); aln_exporter.export_alignments(hsps_arr, "alignment-"+sequence_ids.length+"_hits"); + return false; }, downloadAlignmentOfSelected: function () { var sequence_ids = $('.hit-links :checkbox:checked').map(function () { return this.value; @@ -975,10 +966,11 @@ }); } }); }, this)); aln_exporter.export_alignments(hsps_arr, "alignment-"+sequence_ids.length+"_hits"); + return false; }, // JSX // render: function () { @@ -1041,32 +1033,31 @@ </h4> </div> <ul className="nav"> { !this.props.data.imported_xml && <li> - <a className="download-fasta-of-all" + <a href="#" className="btn-link download-fasta-of-all" onClick={this.downloadFastaOfAll}> FASTA of all hits </a> </li> } { - !this.props.data.imported_xml && <li> - <a - className="download-fasta-of-selected disabled" - onClick={this.downloadFastaOfSelected}> - FASTA of <span className="text-bold"></span> selected hit(s) - </a> - </li> + !this.props.data.imported_xml && <li> + <a href="#" className="btn-link download-fasta-of-selected disabled" + onClick={this.downloadFastaOfSelected}> + FASTA of <span className="text-bold"></span> selected hit(s) + </a> + </li> } <li> - <a className="download-alignment-of-all" + <a href="#" className="btn-link download-alignment-of-all" onClick={this.downloadAlignmentOfAll}> Alignment of all hits </a> </li> <li> - <a className="download-alignment-of-selected disabled" + <a href="#" className="btn-link download-alignment-of-selected disabled" onClick={this.downloadAlignmentOfSelected}> Alignment of <span className="text-bold"></span> selected hit(s) </a> </li> {