Commit 961f44b9 authored by Amanda Ghassaei's avatar Amanda Ghassaei

keep seq in sync with assembly

parent 95cf091f
......@@ -3,18 +3,20 @@
*/
define(['jquery', 'underscore', 'menuParent', 'dnaExport', 'text!menus/templates/DNAExportMenuView.html'],
function($, _, MenuParentView, dnaExport, template){
define(['jquery', 'underscore', 'menuParent', 'dnaExport', 'lattice', 'text!menus/templates/DNAExportMenuView.html'],
function($, _, MenuParentView, dnaExport, lattice, template){
return MenuParentView.extend({
events: {
"click #saveSequences": "_saveToFile"
"click #saveSequences": "_saveToFile",
"click #calcSequences": "_calcSequences"
},
_initialize: function(){
this.listenTo(dnaExport, "change", this.render);
},
_saveToFile: function(e){
......@@ -22,8 +24,13 @@ define(['jquery', 'underscore', 'menuParent', 'dnaExport', 'text!menus/templates
dnaExport.save();
},
_calcSequences: function(e){
e.preventDefault();
dnaExport.generateSequences();
},
_makeTemplateJSON: function(){
return dnaExport.toJSON();
return _.extend(dnaExport.toJSON(), lattice.toJSON());
},
template: _.template(template)
......
<% if(sequence32.length + sequence16.length != numCells){ %>
<div class="inlineWarning">
The number of sequences calculated does not match the number of cells in your assembly. Switch to part type "DNA" and then hit "Re-Calc Sequences" to fix this.
</div>
<% } %>
<% if(sequence32.length > 0){ %>
32bp sequences:<br/>
<div class="sequenceOutput">
......@@ -18,4 +23,5 @@
<% } else { %>
no 16bp sequences<br/>
<% } %><br/>
<a href="#" id="calcSequences" class="btn btn-block btn-lg btn-default">(Re)-Calc Sequences</a><br/>
<a href="#" id="saveSequences" class="btn btn-block btn-lg btn-success">Save to File</a><br/>
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