Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMDesign
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amanda Ghassaei
DMDesign
Commits
cf45fb09
Commit
cf45fb09
authored
Jan 27, 2015
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
menu event binding
parent
a2401f27
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
js/fea/dmaCell.js
+1
-2
1 addition, 2 deletions
js/fea/dmaCell.js
js/menus/LatticeMenuView.js
+10
-1
10 additions, 1 deletion
js/menus/LatticeMenuView.js
js/menus/MenuWrapper.js
+9
-0
9 additions, 0 deletions
js/menus/MenuWrapper.js
js/menus/PartMenuView.js
+4
-0
4 additions, 0 deletions
js/menus/PartMenuView.js
with
24 additions
and
3 deletions
js/fea/dmaCell.js
+
1
−
2
View file @
cf45fb09
...
...
@@ -27,8 +27,6 @@
this
.
position
=
position
;
this
.
drawForMode
(
mode
,
position
);
this
.
_draw
();
// this.parts = this._createParts(nodes, config);
}
...
...
@@ -38,6 +36,7 @@
// parts.push(new Part(nodes[i], config[i]));
// }
// return parts;
return
null
;
};
Cell
.
prototype
.
_buildCellMesh
=
function
(
position
){
//abstract mesh representation of cell
...
...
This diff is collapsed.
Click to expand it.
js/menus/LatticeMenuView.js
+
10
−
1
View file @
cf45fb09
...
...
@@ -12,10 +12,17 @@ LatticeMenuView = Backbone.View.extend({
},
currentlySelected
:
false
,
initialize
:
function
(){
_
.
bindAll
(
this
,
"
render
"
);
this
.
listenTo
(
this
.
model
,
"
change
"
,
this
.
render
);
this
.
listenTo
(
this
.
model
,
"
change
"
,
function
(){
if
(
!
this
.
currentlySelected
)
return
;
if
(
!
this
.
model
.
hasChanged
(
'
cellMode
'
)){
//I want to ignore cellMode changes and listen to everything else
this
.
render
();
}
});
},
_clearCells
:
function
(
e
){
...
...
@@ -30,7 +37,9 @@ LatticeMenuView = Backbone.View.extend({
},
render
:
function
(){
this
.
currentlySelected
=
true
;
//if this causes a change, render must have been called from menu wrapper
this
.
$el
.
html
(
this
.
template
(
_
.
extend
(
this
.
model
.
attributes
,
this
.
_formatData
())));
this
.
model
.
set
(
"
cellMode
"
,
"
cell
"
);
},
template
:
_
.
template
(
'
\
...
...
This diff is collapsed.
Click to expand it.
js/menus/MenuWrapper.js
+
9
−
0
View file @
cf45fb09
...
...
@@ -26,6 +26,7 @@ function MenuWrapper(args){
});
$this
.
parent
().
addClass
(
"
active
"
);
deselectAllMenus
();
var
tabName
=
$this
.
parent
().
data
(
'
name
'
);
if
(
tabName
==
"
lattice
"
){
latticeMenu
.
render
();
...
...
@@ -43,6 +44,14 @@ function MenuWrapper(args){
}
});
function
deselectAllMenus
(){
latticeMenu
.
currentlySelected
=
false
;
// importMenu.currentlySelected = false;
// sketchMenu.currentlySelected = false;
partMenu
.
currentlySelected
=
false
;
// scriptMenu.currentlySelected = false;
}
function
init
(){
latticeMenu
.
render
();
//init with lattice menu open
}
...
...
This diff is collapsed.
Click to expand it.
js/menus/PartMenuView.js
+
4
−
0
View file @
cf45fb09
...
...
@@ -9,6 +9,8 @@ PartMenuView = Backbone.View.extend({
events
:
{
},
currentlySelected
:
false
,
initialize
:
function
(){
_
.
bindAll
(
this
,
"
render
"
);
...
...
@@ -16,7 +18,9 @@ PartMenuView = Backbone.View.extend({
},
render
:
function
(){
this
.
currentlySelected
=
true
;
//if this causes a change, render must have been called from menu wrapper
this
.
$el
.
html
(
this
.
template
(
this
.
model
.
attributes
));
this
.
model
.
set
(
"
cellMode
"
,
"
parts
"
);
},
template
:
_
.
template
(
'
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment