Commit 3f02c43f authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

changing way menu items are organized

parent e2e80b96
......@@ -60,7 +60,6 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
function geometryPreProcess(geometry){//todo do this better
if(geometry === undefined || (geometry.vertices && geometry.vertices.length == 0)) return null;
console.log(json.translation);
if (json.translation) geometry.applyMatrix(new THREE.Matrix4().makeTranslation(json.translation.x, json.translation.y, json.translation.z));
if (json.rotation) {
if (json.rotation.x) geometry.applyMatrix(new THREE.Matrix4().makeRotationX(json.rotation.x));
......
......@@ -3,7 +3,8 @@
*/
define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu', 'appState'], function($, _, Backbone, fileSaver, NavViewMenu, appState){
define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu', 'appState', 'plist'],
function($, _, Backbone, fileSaver, NavViewMenu, appState, plist){
return Backbone.View.extend({
......@@ -65,9 +66,7 @@ define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu', 'appStat
_updateNavSelectionUI: function(){
this._deselectAllNavItems();
var navSelection = this.model.get("currentNav");
if (navSelection == "electronicNavSim" || navSelection == "mechanicalNavSim") navSelection = "navSim";
if (navSelection == "navComposite" || navSelection == "navMaterial") navSelection = "navDesign";
if (navSelection == "navMachineComponent") navSelection = "navAssemble";
if (plist.allMenus[navSelection].parent) navSelection = plist.allMenus[navSelection].parent;
_.each($(".menuHoverControls"), function(link){
var $link = $(link);
if ($link.data("menuId") == navSelection) $link.parent().addClass("open");//highlight
......
<ul class="nav nav-tabs nav-justified">
<% _.each(_.keys(allMenuTabs[currentNav]), function(key){
<% _.each(allMenus[currentNav].tabs, function(tabName, key){
if (key == "part" && !(allPartTypes[cellType][connectionType])) return; %>
<li role="presentation" class="menuWrapperTab" data-name="<%= key %>"><a href="#"><%= allMenuTabs[currentNav][key] %></a></li>
<li role="presentation" class="menuWrapperTab" data-name="<%= key %>"><a href="#"><%= tabName %></a></li>
<% }); %>
</ul>
\ No newline at end of file
......@@ -104,7 +104,7 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu
_navChanged: function(){
//update to last tab open in that section
var navSelection = this.get("currentNav");
var nextTab = this.get("lastNavTab")[navSelection] || _.keys(plist.allMenuTabs[navSelection])[0];
var nextTab = this.get("lastNavTab")[navSelection] || _.keys(plist.allMenus[navSelection].tabs)[0];
this.set("currentTab", nextTab, {silent:true});
if (navSelection == "navDesign") {
......
......@@ -5,50 +5,86 @@ define(['three'], function(THREE){
return {
allMenuTabs: {
allMenus: {
navDesign:{
lattice:"Lattice",
//sketch:"Sketch",
material:"Materials",
import:"Import",
part:"Part"
// script:"Script"
name: "Design",
tabs:{
lattice:"Lattice",
//sketch:"Sketch",
material:"Materials",
import:"Import",
part:"Part"
//script:"Script"
}
},
navMaterial:{
name: "Materials",
parent: "navDesign",
tabs:{
materialEditor: "Material Editor"
}
},
navComposite:{
name: "Composite",
parent: "navDesign",
tabs:{
composite:"Composite Editor"
}
},
navSim:{
name: "Simulate",
tabs:{
}
},
electronicNavSim:{
eSetup:"Connectivity",
// materialProperties: "Materials",
eStatic:"Statics",
eDynamic:"Dynamics"
name: "Electronic Simulation",
parent: "navSim",
tabs:{
eSetup:"Connectivity",
// materialProperties: "Materials",
eStatic:"Statics",
eDynamic:"Dynamics"
}
},
mechanicalNavSim:{
mSetup:"Setup",
// materialProperties: "Materials",
mStatic:"Statics",
mDynamic:"Dynamics"
name: "Mechanical Simulation",
parent: "navSim",
tabs:{
mSetup:"Setup",
// materialProperties: "Materials",
mStatic:"Statics",
mDynamic:"Dynamics"
}
},
navOptimize:{
optimize:"Optimize"
name: "Optimize",
tabs:{
optimize:"Optimize"
}
},
navAssemble:{
assembler:"Assembler",
assemblerSetup: "Setup",
cam: "Process",
// editCamOutput: "Edit",
animate:"Preview"
name: "Assemble",
tabs:{
assembler:"Assembler",
assemblerSetup: "Setup",
cam: "Process",
// editCamOutput: "Edit",
animate:"Preview"
},
},
navMachineComponent:{
editComponent: "Edit Component"
name: "Component Editor",
parent: "navAssemble",
tabs:{
editComponent: "Edit Component"
}
},
navComm:{
setupComm: "Setup",
send: "Send"
},
//maybe do something different here?
navComposite:{
composite:"Composite Editor"
},
navMaterial:{
materialEditor: "Material Editor"
name: "Comm",
tabs:{
setupComm: "Setup",
send: "Send"
}
}
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment