aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJon Reid2012-06-15 11:56:54 -0700
committerJon Reid2012-06-15 11:56:54 -0700
commitf22de35e1ef0624db31263188f764dce0111c352 (patch)
tree604e75baa7b8935a1eec70b9fc6b399f04b3cded /js
parent526ac54f73d53e1e2a3d6a4dbf4f9992c143baf7 (diff)
downloadninja-f22de35e1ef0624db31263188f764dce0111c352.tar.gz
Timeline: Replace currentSelectedContainer with new model.domContainer.
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/elements/element-controller.js4
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js7
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html1
3 files changed, 7 insertions, 5 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index a474961a..fcb121ee 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -18,10 +18,10 @@ exports.ElementController = Montage.create(Component, {
18 // Updated to use new methods in TimelinePanel. JR. 18 // Updated to use new methods in TimelinePanel. JR.
19 var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); 19 var insertionIndex = this.application.ninja.timeline.getInsertionIndex();
20 if (insertionIndex === false) { 20 if (insertionIndex === false) {
21 this.application.ninja.currentSelectedContainer.appendChild(el); 21 this.application.ninja.currentDocument.model.domContainer.appendChild(el);
22 } else { 22 } else {
23 if (insertionIndex === 0) { 23 if (insertionIndex === 0) {
24 this.application.ninja.currentSelectedContainer.appendChild(el); 24 this.application.ninja.currentDocument.model.domContainer.appendChild(el);
25 } else { 25 } else {
26 var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; 26 var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement;
27 element.parentNode.insertBefore(el, element.nextSibling); 27 element.parentNode.insertBefore(el, element.nextSibling);
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 734b051f..bb3ff170 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -702,6 +702,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
702 // cache Timeline data in currentDocument. 702 // cache Timeline data in currentDocument.
703 cacheTimeline: { 703 cacheTimeline: {
704 value: function() { 704 value: function() {
705 if (typeof(this.application.ninja) === "undefined") {
706 return;
707 }
705 // Store the timeline data in currentDocument... 708 // Store the timeline data in currentDocument...
706 if (this._boolCacheArrays) { 709 if (this._boolCacheArrays) {
707 // ... but only if we're supposed to. 710 // ... but only if we're supposed to.
@@ -1397,10 +1400,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1397 // Ordinarily we could use this.getInsertionIndex BUT the new element 1400 // Ordinarily we could use this.getInsertionIndex BUT the new element
1398 // insertion and selection has already fired, so getInsertionIndex will return 1401 // insertion and selection has already fired, so getInsertionIndex will return
1399 // incorrect info. So we need to look at the DOM. 1402 // incorrect info. So we need to look at the DOM.
1400 var childrenLength = this.application.ninja.currentSelectedContainer.children.length, 1403 var childrenLength = this.application.ninja.currentDocument.model.domContainer.children.length,
1401 newIndex = childrenLength -1; 1404 newIndex = childrenLength -1;
1402 for (i = 0; i < childrenLength; i++) { 1405 for (i = 0; i < childrenLength; i++) {
1403 var currTest = this.application.ninja.currentSelectedContainer.children[i]; 1406 var currTest = this.application.ninja.currentDocument.model.domContainer.children[i];
1404 if (object == currTest) { 1407 if (object == currTest) {
1405 myIndex = newIndex - i; 1408 myIndex = newIndex - i;
1406 } 1409 }
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
index a8ef0d6b..502c455b 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
@@ -19,7 +19,6 @@
19 "tween": {"@" : "tween"}, 19 "tween": {"@" : "tween"},
20 "mainCollapser" : {"@" : "mainCollapser"}, 20 "mainCollapser" : {"@" : "mainCollapser"},
21 "positionCollapser" : {"@" : "positionCollapser"}, 21 "positionCollapser" : {"@" : "positionCollapser"},
22 "transformCollapser" : {"@" : "transformCollapser"},
23 "styleCollapser" : {"@" : "styleCollapser"} 22 "styleCollapser" : {"@" : "styleCollapser"}
24 } 23 }
25 }, 24 },