diff --git a/js/cam/Cam.js b/js/cam/Cam.js index 64fd5037c89c51923aa8832256d14901854d8595..ec5e6d15dd418c7e110cc4385e9bd16a3eabb382 100644 --- a/js/cam/Cam.js +++ b/js/cam/Cam.js @@ -158,7 +158,7 @@ define(['underscore', 'three', 'backbone', 'appState', 'latticeCAM', 'threeModel if (appState.get("currentNav") == "navAssemble") { this._setDefaultMachineForLatticeType(); this._calculateNumMaterials(); - } + } else if (!this.isVisible() && this.get("assembler")) this.get("assembler").setVisibility(false); }, _setDefaultMachineForLatticeType: function(){ @@ -179,7 +179,6 @@ define(['underscore', 'three', 'backbone', 'appState', 'latticeCAM', 'threeModel _setCAMVisibility: function(){ var visible = this.isVisible(); - console.log(visible); // this.get("origin").visible = visible; // this.get("stock").visible = visible; if (visible && !this.get("assembler")) this.selectMachine(); @@ -217,8 +216,8 @@ define(['underscore', 'three', 'backbone', 'appState', 'latticeCAM', 'threeModel isVisible: function(){ var currentTab = appState.get("currentTab"); var currentNav = appState.get("currentNav"); - return (currentTab == "assemblerSetup" || currentTab == "cam" || currentTab == "animation" || currentNav == "navComm" - || currentTab == "editComponent"); + return ((currentTab == "assemblerSetup" || currentTab == "cam" || currentTab == "animation" + || currentTab == "editComponent") && currentNav == "navAssemble" || currentNav == "navComm"); }, diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index d533bfc56e11a4ddb8f896eb0e88315dc7ade813..e6650efcc2be4f15da1c94623658e47b51aad156 100644 --- a/js/cells/DMACell.js +++ b/js/cells/DMACell.js @@ -219,6 +219,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' DMACell.prototype.show = function(mode){ this.object3D.visible = true; + this._setTransparent(false); this.setMode(mode); }; @@ -256,7 +257,10 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' }; DMACell.prototype.setTransparent = function(evalFunction){ - var transparent = evalFunction(this); + this._setTransparent(evalFunction(this)) + }; + + DMACell.prototype._setTransparent = function(transparent){ if (transparent == this.isTransparent) return; this.isTransparent = transparent; this._setTHREEMaterial(this.getMaterial(true)); diff --git a/js/models/AppState.js b/js/models/AppState.js index e07abab9844b6d64e1004a6de19547a5f9a19da8..83806596d3f9fcfbf617e9bc25db73ec125fbf95 100644 --- a/js/models/AppState.js +++ b/js/models/AppState.js @@ -125,6 +125,7 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], } if (this.get("cellMode") == "hide") this.set("cellMode", "cell"); + this.lattice.showCells(); }, _materialTypeChanged: function(){