From f22de35e1ef0624db31263188f764dce0111c352 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 15 Jun 2012 11:56:54 -0700 Subject: Timeline: Replace currentSelectedContainer with new model.domContainer. --- js/controllers/elements/element-controller.js | 4 ++-- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 7 +++++-- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'js') 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, { // Updated to use new methods in TimelinePanel. JR. var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); if (insertionIndex === false) { - this.application.ninja.currentSelectedContainer.appendChild(el); + this.application.ninja.currentDocument.model.domContainer.appendChild(el); } else { if (insertionIndex === 0) { - this.application.ninja.currentSelectedContainer.appendChild(el); + this.application.ninja.currentDocument.model.domContainer.appendChild(el); } else { var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; 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, { // cache Timeline data in currentDocument. cacheTimeline: { value: function() { + if (typeof(this.application.ninja) === "undefined") { + return; + } // Store the timeline data in currentDocument... if (this._boolCacheArrays) { // ... but only if we're supposed to. @@ -1397,10 +1400,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // Ordinarily we could use this.getInsertionIndex BUT the new element // insertion and selection has already fired, so getInsertionIndex will return // incorrect info. So we need to look at the DOM. - var childrenLength = this.application.ninja.currentSelectedContainer.children.length, + var childrenLength = this.application.ninja.currentDocument.model.domContainer.children.length, newIndex = childrenLength -1; for (i = 0; i < childrenLength; i++) { - var currTest = this.application.ninja.currentSelectedContainer.children[i]; + var currTest = this.application.ninja.currentDocument.model.domContainer.children[i]; if (object == currTest) { myIndex = newIndex - i; } 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 @@ "tween": {"@" : "tween"}, "mainCollapser" : {"@" : "mainCollapser"}, "positionCollapser" : {"@" : "positionCollapser"}, - "transformCollapser" : {"@" : "transformCollapser"}, "styleCollapser" : {"@" : "styleCollapser"} } }, -- cgit v1.2.3