Skip to content
Snippets Groups Projects
Commit 00781bf4 authored by amandaghassaei's avatar amandaghassaei
Browse files

eod

parent 951c893e
Branches
No related tags found
No related merge requests found
......@@ -90,7 +90,8 @@ CamMenuView = Backbone.View.extend({
Stock (xyz): &nbsp;&nbsp;<input data-type="x" value="<%= stockPosition.x %>" placeholder="X" class="form-control numberInput stockPosition" type="text">\
&nbsp;<input data-type="y" value="<%= stockPosition.y %>" placeholder="Y" class="form-control numberInput stockPosition" type="text">\
&nbsp;<input data-type="z" value="<%= stockPosition.z %>" placeholder="Z" class="form-control numberInput stockPosition" type="text"><br/><br/>\
Rapid Speeds (xy, z): &nbsp;&nbsp;<input data-type="xy" value="<%= rapidSpeeds.xy %>" placeholder="XY" class="form-control numberInput rapidSpeeds" type="text">\
Speeds (measured in <%= units %> per second):<br/><br/>\
Rapids (xy, z): &nbsp;&nbsp;<input data-type="xy" value="<%= rapidSpeeds.xy %>" placeholder="XY" class="form-control numberInput rapidSpeeds" type="text">\
&nbsp;<input data-type="z" value="<%= rapidSpeeds.z %>" placeholder="Z" class="form-control numberInput rapidSpeeds" type="text"><br/><br/>\
Feed Rate (xy, z): &nbsp;&nbsp;<input data-type="xy" value="<%= feedRate.xy %>" placeholder="XY" class="form-control numberInput feedRate" type="text">\
&nbsp;<input data-type="z" value="<%= feedRate.z %>" placeholder="Z" class="form-control numberInput feedRate" type="text">\
......
......@@ -25,9 +25,23 @@ LatticeMenuView = Backbone.View.extend({
this.lattice = options.lattice;
_.bindAll(this, "render");
_.bindAll(this, "_onKeyup");
//bind events
this.listenTo(this.lattice, "change", this.render);
$(document).bind('keyup', {state:false}, this._onKeyup);
},
_onKeyup: function(e){
if ($(".cellSeparation").is(":focus")) this._updateNumber(e, "cellSeparation");
},
_updateNumber: function(e, property){
e.preventDefault();
var newVal = parseFloat($(e.target).val());
if (isNaN(newVal)) return;
var object = this.lattice.get(property);
object[$(e.target).data("type")] = newVal;
this.lattice.trigger("change:"+property);
},
_clearCells: function(e){
......@@ -151,7 +165,11 @@ LatticeMenuView = Backbone.View.extend({
<% }); %>\
</ul>\
</div><br/><br/>\
Num Cells:&nbsp;&nbsp;<%= numCells %><br/>\
Cell Separation <% if (connectionType != "freeformFace"){ %>(xy, z): &nbsp;&nbsp;<input data-type="xy" value="<%= cellSeparation.xy %>" placeholder="XY" class="form-control numberInput cellSeparation" type="text">\
&nbsp;<input data-type="z" value="<%= cellSeparation.z %>" placeholder="Z" class="form-control numberInput cellSeparation" type="text">\
<% } else { %>( radial ): &nbsp;&nbsp;<input data-type="xy" value="<%= cellSeparation.xy %>" placeholder="XY" class="form-control numberInput cellSeparation" type="text"><% } %>\
<br/><br/>\
Num Cells:&nbsp;&nbsp;<%= numCells %><br/><br/>\
<br/>\
<a href="#" id="latticeMenuClearCells" class=" btn btn-block btn-lg btn-default">Clear All Cells</a><br/>\
hint: click to create cells, shift+drag to create a lot of cells, d+click to delete cells<br/>\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment