Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AMOEBA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amanda Ghassaei
AMOEBA
Commits
9552dfe6
Commit
9552dfe6
authored
May 21, 2016
by
amandaghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added hier menu
parent
bbc11d4f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
8 deletions
+77
-8
css/main.css
css/main.css
+11
-1
index.html
index.html
+7
-1
js/main.js
js/main.js
+1
-0
js/menus/otherUI/NavHierarchicalMenu.js
js/menus/otherUI/NavHierarchicalMenu.js
+36
-0
js/menus/otherUI/Navbar.js
js/menus/otherUI/Navbar.js
+14
-5
js/menus/templates/NavHierarchicalMenu.html
js/menus/templates/NavHierarchicalMenu.html
+4
-0
js/models/AppState.js
js/models/AppState.js
+4
-1
No files found.
css/main.css
View file @
9552dfe6
...
...
@@ -406,7 +406,7 @@ label {
padding-bottom
:
20px
;
}
#navViewMenu
.dropdown-menu
span
{
#navViewMenu
.dropdown-menu
span
,
#navHierarchicalMenu
span
{
margin-right
:
10px
;
}
...
...
@@ -499,6 +499,16 @@ label {
padding
:
6px
9px
;
}
.navbar-inverse
.navbar-nav
>
.navSelectedTab
>
a
,
.navbar-inverse
.navbar-nav
>
.navSelectedTab
>
a
:hover
,
.navbar-inverse
.navbar-nav
>
.navSelectedTab
>
a
:focus
{
color
:
#fff
;
background-color
:
#aaa
;
border-left-color
:
transparent
;
}
#navDesignTab
>
.dropdown-menu
{
min-width
:
112px
;
}
.navbar-inverse
.navbar-nav
>
.dropdown
>
a
.caret
{
border-top-color
:
#ddd
;
border-bottom-color
:
#ddd
;
...
...
index.html
View file @
9552dfe6
...
...
@@ -114,7 +114,13 @@
<li><a
id=
"exportSTL"
href=
"#"
>
Export STL
</a></li>
</ul>
</li>
<li><a
data-menu-id=
"navDesign"
class=
"menuHoverControls"
href=
"#"
>
Design
</a></li>
<li
class=
"dropdown navDropdown"
id=
"navDesignTab"
>
<a
href=
"#"
data-menu-id=
"navDesign"
class=
"menuHoverControls"
>
Design
<b
class=
"caret"
></b></a>
<span
class=
"dropdown-arrow"
></span>
<ul
id=
"navHierarchicalMenu"
class=
"dropdown-menu"
>
</ul>
</li>
<!--<li><a data-menu-id="navDesign" class="menuHoverControls" href="#">Design</a></li>-->
<li><a
data-menu-id=
"navSim"
class=
"menuHoverControls"
href=
"#"
>
Simulate
</a></li>
<li
class=
"dropdown navDropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
id=
"viewMenuDropdown"
data-toggle=
"dropdown"
>
View
<b
class=
"caret"
></b></a>
...
...
js/main.js
View file @
9552dfe6
...
...
@@ -79,6 +79,7 @@ require.config({
//UI
navbar
:
'
menus/otherUI/Navbar
'
,
navViewMenu
:
'
menus/otherUI/NavViewMenu
'
,
//view dropdown
navHierarchicalMenu
:
'
menus/otherUI/NavHierarchicalMenu
'
,
//design dropdown
ribbon
:
'
menus/otherUI/Ribbon
'
,
modalView
:
'
menus/otherUI/ModalView
'
,
console
:
'
menus/otherUI/Console
'
,
...
...
js/menus/otherUI/NavHierarchicalMenu.js
0 → 100644
View file @
9552dfe6
/**
* Created by ghassaei on 5/21/16.
*/
define
([
'
jquery
'
,
'
underscore
'
,
'
backbone
'
,
'
text!menus/templates/NavHierarchicalMenu.html
'
],
function
(
$
,
_
,
Backbone
,
template
){
return
Backbone
.
View
.
extend
({
el
:
"
#navHierarchicalMenu
"
,
events
:
{
"
click a
"
:
"
_makeSelection
"
},
initialize
:
function
(){
_
.
bindAll
(
this
,
"
render
"
);
},
_makeSelection
:
function
(
e
){
e
.
preventDefault
();
var
$target
=
$
(
e
.
target
);
if
(
$target
.
data
(
"
hierlevel
"
))
this
.
model
.
set
(
"
hierLevel
"
,
$target
.
data
(
"
hierlevel
"
));
console
.
log
(
this
.
model
.
get
(
"
hierLevel
"
));
},
render
:
function
(){
this
.
$el
.
html
(
this
.
template
(
this
.
model
.
toJSON
()));
},
template
:
_
.
template
(
template
)
});
});
\ No newline at end of file
js/menus/otherUI/Navbar.js
View file @
9552dfe6
...
...
@@ -3,8 +3,8 @@
*/
define
([
'
jquery
'
,
'
underscore
'
,
'
backbone
'
,
'
fileSaver
'
,
'
navViewMenu
'
,
'
appState
'
,
'
plist
'
,
'
threeModel
'
],
function
(
$
,
_
,
Backbone
,
fileSaver
,
NavViewMenu
,
appState
,
plist
,
three
){
define
([
'
jquery
'
,
'
underscore
'
,
'
backbone
'
,
'
fileSaver
'
,
'
navViewMenu
'
,
'
navHierarchicalMenu
'
,
'
appState
'
,
'
plist
'
,
'
threeModel
'
],
function
(
$
,
_
,
Backbone
,
fileSaver
,
NavViewMenu
,
NavHierarchicalMenu
,
appState
,
plist
,
three
){
return
Backbone
.
View
.
extend
({
...
...
@@ -13,6 +13,7 @@ define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu', 'appStat
events
:
{
"
click #showHideMenu
"
:
"
_setMenuVisibility
"
,
"
click .menuHoverControls
"
:
"
_setNavSelection
"
,
"
click .hierDropdown
"
:
"
_setHierarchicalLevel
"
,
"
shown.bs.modal .modal
"
:
"
_showModal
"
,
"
hide.bs.modal .modal
"
:
"
_hideModal
"
,
...
...
@@ -37,6 +38,7 @@ define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu', 'appStat
initialize
:
function
(){
this
.
viewMenu
=
new
NavViewMenu
({
model
:
this
.
model
});
this
.
hierarchicalMenu
=
new
NavHierarchicalMenu
({
model
:
this
.
model
});
_
.
bindAll
(
this
,
"
_setMenuVisibility
"
,
"
_setNavSelection
"
);
...
...
@@ -63,8 +65,9 @@ define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu', 'appStat
if
(
navSelection
==
"
navSim
"
){
//choose which simulation package to pull up
this
.
model
.
set
(
"
currentNav
"
,
appState
.
get
(
"
materialClass
"
)
+
"
NavSim
"
);
return
;
}
else
if
(
navSelection
==
"
navAssemble
"
){
//choose which assembly package to pull up
if
(
this
.
model
.
get
(
"
materialClass
"
)
==
"
dna
"
)
navSelection
=
"
navDNAAssemble
"
;
}
else
if
(
navSelection
==
"
navDesign
"
&&
appState
.
get
(
"
currentNav
"
)
==
"
navDesign
"
){
//optionally show the design dropdown
this
.
hierarchicalMenu
.
render
();
$
(
e
.
target
).
parent
().
addClass
(
"
open
"
);
}
if
(
navSelection
)
this
.
model
.
set
(
"
currentNav
"
,
navSelection
);
...
...
@@ -77,10 +80,15 @@ define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu', 'appStat
else
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
if
(
$link
.
data
(
"
menuId
"
)
==
navSelection
)
$link
.
parent
().
addClass
(
"
navSelectedTab
"
);
//highlight
});
},
_setHierarchicalLevel
:
function
(
e
){
e
.
preventDefault
();
$
(
"
.open
"
).
removeClass
(
"
open
"
);
},
_logo
:
function
(){
var
$logo
=
$
(
"
#logo
"
);
$logo
.
mouseover
(
function
(){
...
...
@@ -93,6 +101,7 @@ define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu', 'appStat
_deselectAllNavItems
:
function
(){
$
(
"
.open
"
).
removeClass
(
"
open
"
);
//no highlight
$
(
"
.navSelectedTab
"
).
removeClass
(
"
navSelectedTab
"
);
//no highlight
},
_showModal
:
function
(
e
){
...
...
js/menus/templates/NavHierarchicalMenu.html
0 → 100644
View file @
9552dfe6
<li><a
class=
"hierDropdown"
data-hierlevel=
"element"
href=
"#"
><
%
if
(hierLevel=
="element"){
%
><span
class=
"fui-check"
></span>
<
%
}
%
>
Element
</a></li>
<li><a
class=
"hierDropdown"
data-hierlevel=
"function"
href=
"#"
><
%
if
(hierLevel=
="function"){
%
><span
class=
"fui-check"
></span>
<
%
}
%
>
Function
</a></li>
<li><a
class=
"hierDropdown"
data-hierlevel=
"module"
href=
"#"
><
%
if
(hierLevel=
="module"){
%
><span
class=
"fui-check"
></span>
<
%
}
%
>
Module
</a></li>
<li><a
class=
"hierDropdown"
data-hierlevel=
"system"
href=
"#"
><
%
if
(hierLevel=
="system"){
%
><span
class=
"fui-check"
></span>
<
%
}
%
>
System
</a></li>
\ No newline at end of file
js/models/AppState.js
View file @
9552dfe6
...
...
@@ -37,7 +37,10 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'],
realisticColorScheme
:
false
,
materialType
:
null
,
materialClass
:
null
materialClass
:
null
,
//hierarchy
hierLevel
:
"
function
"
//element, function, module, system
},
initialize
:
function
(){
...
...
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