From f0e98bf4c9259eb431ec862dd40fdfe4a8cafae3 Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Fri, 6 Feb 2015 17:34:34 -0500 Subject: [PATCH] more menu stuff --- js/menus/MenuWrapperView.js | 8 ++++---- js/menus/PartMenuView.js | 6 +++--- js/menus/ScriptMenuView.js | 4 +--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/js/menus/MenuWrapperView.js b/js/menus/MenuWrapperView.js index b5ee36b5..cd6c279e 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 ac6a8c8a..e266c671 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 4dda3b65..324e4b79 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()); }, -- GitLab