diff --git a/js/menus/MenuWrapperView.js b/js/menus/MenuWrapperView.js index b5ee36b55277eb400407faf6119052e65d097db2..cd6c279e90ad961ce201c0cd8ef2fe76e2cbdc22 100644 --- a/js/menus/MenuWrapperView.js +++ b/js/menus/MenuWrapperView.js @@ -17,10 +17,10 @@ MenuWrapper = Backbone.View.extend({ //init all tab view controllers this.latticeMenu = new LatticeMenuView({model:this.model, lattice:options.lattice}); -// this.importMenu = new ImportMenuView({lattice:options.lattice, appState:this.model}); -// this.sketchMenu = new SketchMenuView({model:options.lattice.get("basePlane"), appState:this.model}); -// this.partMenu = new PartMenuView({model:options.lattice, appState:this.model}); -// this.scriptMenu = new ScriptMenuView({appState:this.model}); + this.importMenu = new ImportMenuView({lattice:options.lattice, appState:this.model}); + this.sketchMenu = new SketchMenuView({model:options.lattice.get("basePlane"), appState:this.model}); + this.partMenu = new PartMenuView({model:this.model, lattice:options.lattice}); + this.scriptMenu = new ScriptMenuView({model:this.model}); // this.animationMenu = new AnimationMenuView({model:options.lattice.get("basePlane"), appState:this.model}); this.lattice = options.lattice; diff --git a/js/menus/PartMenuView.js b/js/menus/PartMenuView.js index ac6a8c8a67daf7240959f0ae2aa4b77ea66ee74a..e266c67183759e0d9a3578b43bd6b2e81b396d7f 100644 --- a/js/menus/PartMenuView.js +++ b/js/menus/PartMenuView.js @@ -12,7 +12,7 @@ PartMenuView = Backbone.View.extend({ initialize: function(options){ - this.appState = options.appState; + this.lattice = options.lattice; _.bindAll(this, "render"); this.listenTo(this.model, "change:partType", this.render); @@ -20,11 +20,11 @@ PartMenuView = Backbone.View.extend({ }, _changeColSeparation: function(e){ - this.model.set("columnSeparation", $(e.target).val()/100); + this.lattice.set("columnSeparation", $(e.target).val()/100); }, render: function(){ - if (this.appState.get("currentTab") != "part") return; + if (this.model.get("currentTab") != "part") return; this.$el.html(this.template(this.model.attributes)); $('#columnSepSlider').slider({ diff --git a/js/menus/ScriptMenuView.js b/js/menus/ScriptMenuView.js index 4dda3b65e9c306eff5b5eded5965e1d53459618f..324e4b79f64d8c2f78f4fe46a5d8f9479bf7f480 100644 --- a/js/menus/ScriptMenuView.js +++ b/js/menus/ScriptMenuView.js @@ -11,13 +11,11 @@ ScriptMenuView = Backbone.View.extend({ initialize: function(options){ - this.appState = options.appState; - _.bindAll(this, "render"); }, render: function(){ - if (this.appState.get("currentTab") != "script") return; + if (this.model.get("currentTab") != "script") return; this.$el.html(this.template()); },