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

keep seq in sync with assembly

parent 95cf091f
...@@ -3,18 +3,20 @@ ...@@ -3,18 +3,20 @@
*/ */
define(['jquery', 'underscore', 'menuParent', 'dnaExport', 'text!menus/templates/DNAExportMenuView.html'], define(['jquery', 'underscore', 'menuParent', 'dnaExport', 'lattice', 'text!menus/templates/DNAExportMenuView.html'],
function($, _, MenuParentView, dnaExport, template){ function($, _, MenuParentView, dnaExport, lattice, template){
return MenuParentView.extend({ return MenuParentView.extend({
events: { events: {
"click #saveSequences": "_saveToFile" "click #saveSequences": "_saveToFile",
"click #calcSequences": "_calcSequences"
}, },
_initialize: function(){ _initialize: function(){
this.listenTo(dnaExport, "change", this.render);
}, },
_saveToFile: function(e){ _saveToFile: function(e){
...@@ -22,8 +24,13 @@ define(['jquery', 'underscore', 'menuParent', 'dnaExport', 'text!menus/templates ...@@ -22,8 +24,13 @@ define(['jquery', 'underscore', 'menuParent', 'dnaExport', 'text!menus/templates
dnaExport.save(); dnaExport.save();
}, },
_calcSequences: function(e){
e.preventDefault();
dnaExport.generateSequences();
},
_makeTemplateJSON: function(){ _makeTemplateJSON: function(){
return dnaExport.toJSON(); return _.extend(dnaExport.toJSON(), lattice.toJSON());
}, },
template: _.template(template) 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){ %> <% if(sequence32.length > 0){ %>
32bp sequences:<br/> 32bp sequences:<br/>
<div class="sequenceOutput"> <div class="sequenceOutput">
...@@ -18,4 +23,5 @@ ...@@ -18,4 +23,5 @@
<% } else { %> <% } else { %>
no 16bp sequences<br/> no 16bp sequences<br/>
<% } %><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/> <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