Skip to content
Snippets Groups Projects
Commit 6ea7ca03 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

partmode logic

parent 31e3236a
No related branches found
No related tags found
No related merge requests found
......@@ -15,10 +15,17 @@ ImportMenuView = Backbone.View.extend({
"click #removeFillGeo": "_removeMesh"
},
initialize: function(){
currentlySelected: false,
initialize: function(options){
this.lattice = options.lattice;
_.bindAll(this, "render", "_onMeshLoad");
this.listenTo(this.model, "change", this.render);
this.listenTo(this.model, "change", function(){
if (!this.currentlySelected) return;
this.render();
});
// this.listenTo(this.model, "change:filename change:boundingBoxHelper", this.render);//boundingBoxHelper covers orientation
......@@ -67,7 +74,9 @@ ImportMenuView = Backbone.View.extend({
},
render: function(){
this.currentlySelected = true;
this.$el.html(this.template(this.model.attributes));
this.lattice.set("cellMode", "cell");
},
// makeDimensionString: function(){
......
......@@ -9,8 +9,8 @@ function MenuWrapper(args){
//init all tab view controllers
var latticeMenu = new LatticeMenuView({model:args.lattice});
var importMenu = new ImportMenuView();
var sketchMenu = new SketchMenuView();
var importMenu = new ImportMenuView({lattice:args.lattice});
var sketchMenu = new SketchMenuView({model:args.lattice});
var partMenu = new PartMenuView({model:args.lattice});
var scriptMenu = new ScriptMenuView();
......@@ -46,8 +46,8 @@ function MenuWrapper(args){
function deselectAllMenus(){
latticeMenu.currentlySelected = false;
// importMenu.currentlySelected = false;
// sketchMenu.currentlySelected = false;
importMenu.currentlySelected = false;
sketchMenu.currentlySelected = false;
partMenu.currentlySelected = false;
// scriptMenu.currentlySelected = false;
}
......
......@@ -15,6 +15,10 @@ PartMenuView = Backbone.View.extend({
_.bindAll(this, "render");
this.listenTo(this.model, "change:partType", this.render);
// this.listenTo(this.model, "change", function(){
// if (!this.currentlySelected) return;
// this.render();
// });
},
render: function(){
......
......@@ -10,13 +10,21 @@ SketchMenuView = Backbone.View.extend({
events: {
},
currentlySelected: false,
initialize: function(){
_.bindAll(this, "render");
// this.listenTo(this.model, "change", function(){
// if (!this.currentlySelected) return;
// this.render();
// });
},
render: function(){
this.currentlySelected = true;
this.$el.html(this.template());
this.model.set("cellMode", "cell");
},
template: _.template('\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment