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
d2965f7e
Commit
d2965f7e
authored
Sep 14, 2015
by
Amanda Ghassaei
Browse files
events timing
parent
3bc775d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/lattice/Lattice.js
View file @
d2965f7e
...
...
@@ -32,8 +32,21 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
this
.
_checkURL
();
this
.
listenTo
(
this
,
"
change:partType
"
,
this
.
_updatePartType
);
this
.
listenTo
(
this
,
"
change:cellType change:connectionType change:latticeType
"
,
function
(){
this
.
_updateLatticeConfig
();
//pass no params
this
.
listenTo
(
this
,
"
change:cellType
"
,
function
(){
this
.
_cellTypeChanged
();
this
.
_reloadCells
();
});
this
.
listenTo
(
this
,
"
change:connectionType
"
,
function
(){
this
.
_connectionTypeChanged
();
this
.
_reloadCells
();
});
this
.
listenTo
(
this
,
"
change:latticeType
"
,
function
(){
this
.
_latticeTypeChanged
();
this
.
_reloadCells
();
});
this
.
listenTo
(
this
,
"
change:aspectRatio
"
,
function
(){
this
.
_reloadCells
();
});
this
.
listenTo
(
appState
,
"
change:currentNav
"
,
this
.
_navChanged
);
...
...
@@ -41,7 +54,8 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
this
.
updateThreeViewTarget
();
});
this
.
_updateLatticeConfig
();
this
.
_latticeTypeChanged
();
this
.
_reloadCells
();
},
_checkURL
:
function
(){
...
...
@@ -57,25 +71,22 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
//latticeType
_setToDefaultsSilently
:
function
(){
var
newCellType
=
this
.
get
(
"
cellType
"
);
var
newConnectionType
=
this
.
get
(
"
connectionType
"
);
var
newLatticeType
=
this
.
get
(
"
latticeType
"
);
if
(
this
.
previous
(
"
cellType
"
)
!==
undefined
&&
newCellType
!=
this
.
previous
(
"
cellType
"
)){
newConnectionType
=
_
.
keys
(
plist
.
allLattices
[
newCellType
].
connection
)[
0
];
this
.
set
(
"
connectionType
"
,
newConnectionType
,
{
silent
:
true
});
}
if
(
this
.
previous
(
"
connectionType
"
)
!==
undefined
&&
newConnectionType
!=
this
.
previous
(
"
connectionType
"
)){
newLatticeType
=
_
.
keys
(
plist
.
allLattices
[
newCellType
].
connection
[
newConnectionType
].
type
)[
0
];
this
.
set
(
"
latticeType
"
,
newLatticeType
,
{
silent
:
true
});
}
_cellTypeChanged
:
function
(){
var
cellType
=
this
.
get
(
"
cellType
"
);
var
connectionType
=
_
.
keys
(
plist
.
allLattices
[
cellType
].
connection
)[
0
];
this
.
set
(
"
connectionType
"
,
connectionType
,
{
silent
:
true
});
this
.
_connectionTypeChanged
();
},
this
.
_updateLatticeType
();
_connectionTypeChanged
:
function
(){
var
cellType
=
this
.
get
(
"
cellType
"
);
var
connectionType
=
this
.
get
(
"
connectionType
"
);
var
latticeType
=
_
.
keys
(
plist
.
allLattices
[
cellType
].
connection
[
connectionType
].
type
)[
0
];
this
.
set
(
"
latticeType
"
,
latticeType
,
{
silent
:
true
});
this
.
_latticeTypeChanged
();
},
_
updateL
atticeType
:
function
(){
_
l
atticeType
Changed
:
function
(){
var
latticeData
=
this
.
_getLatticePlistData
();
this
.
set
(
"
aspectRatio
"
,
latticeData
.
aspectRatio
.
clone
(),
{
silent
:
true
});
...
...
@@ -254,7 +265,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
self
.
compositeEditor
=
new
CompositeEditorLattice
(
_
.
extend
({
id
:
id
},
_
.
omit
(
data
,
"
sparseCells
"
)),
null
,
function
(
_self
){
var
cells
=
null
;
if
(
data
)
cells
=
data
.
sparseCells
;
_self
.
_
updateLatticeConfig
(
cells
,
self
.
_getSubclassForLatticeType
());
_self
.
_
reloadCells
(
cells
,
self
.
_getSubclassForLatticeType
());
appState
.
set
(
"
currentNav
"
,
"
navComposite
"
);
});
...
...
js/lattice/LatticeBase.js
View file @
d2965f7e
...
...
@@ -45,12 +45,9 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
plist
.
allLattices
[
this
.
get
(
"
cellType
"
)].
connection
[
this
.
get
(
"
connectionType
"
)].
type
[
this
.
get
(
"
latticeType
"
)];
},
_
updateLatticeConfig
:
function
(
cells
,
subclass
){
//do not clear cells if loading from file (cells array contains important metadata)
_
reloadCells
:
function
(
cells
,
subclass
){
if
(
!
cells
)
{
if
(
this
.
_setToDefaultsSilently
)
this
.
_setToDefaultsSilently
();
cells
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
sparseCells
));
}
if
(
!
cells
)
cells
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
sparseCells
));
if
(
this
.
_setDefaultCellMode
)
this
.
_setDefaultCellMode
();
...
...
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