Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
DMDesign
Commits
3f02c43f
Commit
3f02c43f
authored
Aug 22, 2015
by
Amanda Ghassaei
Browse files
changing way menu items are organized
parent
e2e80b96
Changes
5
Hide whitespace changes
Inline
Side-by-side
js/cam/assemblers/Assembler.js
View file @
3f02c43f
...
...
@@ -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
));
...
...
js/menus/Navbar.js
View file @
3f02c43f
...
...
@@ -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
...
...
js/menus/templates/MenuWrapperView.html
View file @
3f02c43f
<ul
class=
"nav nav-tabs nav-justified"
>
<
%
_.each
(
_.keys
(
allMenu
Tab
s
[
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
js/models/AppState.js
View file @
3f02c43f
...
...
@@ -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
.
allMenu
Tab
s
[
navSelection
])[
0
];
var
nextTab
=
this
.
get
(
"
lastNavTab
"
)[
navSelection
]
||
_
.
keys
(
plist
.
allMenus
[
navSelection
]
.
tabs
)[
0
];
this
.
set
(
"
currentTab
"
,
nextTab
,
{
silent
:
true
});
if
(
navSelection
==
"
navDesign
"
)
{
...
...
js/plists/PList.js
View file @
3f02c43f
...
...
@@ -5,50 +5,86 @@ define(['three'], function(THREE){
return
{
allMenu
Tab
s
:
{
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
"
}
}
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment