diff --git a/js/menus/MenuWrapperView.js b/js/menus/MenuWrapperView.js index de13a585a351bfdd35b8b848d1478997efdd5389..4ec03ade57c83abe22f642219c46d916c2633a73 100644 --- a/js/menus/MenuWrapperView.js +++ b/js/menus/MenuWrapperView.js @@ -29,11 +29,12 @@ MenuWrapper = Backbone.View.extend({ this.assemblerMenu = new AssemblerMenuView({model:this.model, assembler: dmaGlobals.assembler}); this.animationMenu = new AnimationMenuView({model:lattice.get("basePlane"), appState:this.model}); this.camMenu = new CamMenuView({model:this.model, lattice:lattice, assembler:dmaGlobals.assembler}); + this.sendMenu = new SendMenuView({model:this.model}); //data names and titles this.designMenuTabs = {lattice:"Lattice", import:"Import", sketch:"Sketch", part:"Part", script:"Script"}; this.simMenuTabs = {physics:"Physics", part:"Part", material:"Material", optimize:"Optimize"}; - this.assemMenuTabs = {assembler:"Assembler", animate:"Preview", cam: "Process"}; + this.assemMenuTabs = {assembler:"Assembler", animate:"Preview", cam: "Process", send: "Send"}; //bind events this.listenTo(this.model, "change:currentNav", this.render); @@ -83,6 +84,8 @@ MenuWrapper = Backbone.View.extend({ this.animationMenu.render(); } else if (tabName == "cam"){ this.camMenu.render(); + } else if (tabName == "send"){ + this.sendMenu.render(); } else { console.warn("no tab initialized!"); $("#menuContent").html('Coming Soon.');//clear out content from menu @@ -98,11 +101,11 @@ MenuWrapper = Backbone.View.extend({ }, _populateAndShow: function(){ - this.$el.html(this.template(_.extend(this.model.attributes, + this.$el.html(this.template(_.extend(this.model.toJSON(), {navDesign:this.designMenuTabs, navSim:this.simMenuTabs, navAssemble:this.assemMenuTabs, - }, dmaGlobals.lattice.attributes))); + }, dmaGlobals.lattice.toJSON()))); this._updateCurrentTab(); this._show(); }, diff --git a/js/menus/SendMenuView.js b/js/menus/SendMenuView.js new file mode 100644 index 0000000000000000000000000000000000000000..e4a6cb90a3f77c8c4c33770705c9ad0bac8891f9 --- /dev/null +++ b/js/menus/SendMenuView.js @@ -0,0 +1,26 @@ +/** + * Created by aghassaei on 3/11/15. + */ + +SendMenuView = Backbone.View.extend({ + + el: "#menuContent", + + events: { + }, + + initialize: function(options){ + + _.bindAll(this, "render"); + }, + + render: function(){ + if (this.model.get("currentTab") != "send") return; + this.$el.html(this.template()); + }, + + template: _.template('\ + send commands to machine\ + ') + +}); \ No newline at end of file diff --git a/main.html b/main.html index 1a69364505c4596a32b340c21fd18484584b9930..55757d9a497fad5ceb4e9006439eef8a0013bac5 100644 --- a/main.html +++ b/main.html @@ -81,6 +81,7 @@ <script src="js/menus/AssemblerMenuView.js"></script> <script src="js/menus/AnimationMenuView.js"></script> <script src="js/menus/CamMenuView.js"></script> + <script src="js/menus/SendMenuView.js"></script> <script src="js/threeViews/Highlighter.js"></script> <script src="js/threeViews/ThreeView.js"></script>