aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-09 09:28:08 -0800
committerNivesh Rajbhandari2012-03-09 09:28:08 -0800
commitc792c7a82a6247524d3c5bfab5eaa1258931a401 (patch)
treedf06b94977920daa6450406b1edca380f8731b90 /js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
parent86784888a98a05523dbedcbe32fd4dea336878e7 (diff)
parent3a9c7a57a227a36ec47c6635fc6a0bd4c4b7f9c3 (diff)
downloadninja-c792c7a82a6247524d3c5bfab5eaa1258931a401.tar.gz
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js560
1 files changed, 263 insertions, 297 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 59306705..087bf3cd 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -44,14 +44,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
44 this._layerRepetition = newVal; 44 this._layerRepetition = newVal;
45 } 45 }
46 }, 46 },
47
47 _cacheArrays : { 48 _cacheArrays : {
48 value: function() { 49 value: function() {
49 // Cache this.arrLayers and this.arrTracks.
50 this.log('cacheArrays ' + this._boolCacheArrays)
51 if (this._boolCacheArrays) { 50 if (this._boolCacheArrays) {
52 this.log('caching arrays for ', this.application.ninja.currentDocument.name);
53 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; 51 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
54 this.application.ninja.currentDocument.tlArrTracks = this.arrTracks; 52
55 } 53 }
56 } 54 }
57 }, 55 },
@@ -72,15 +70,44 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
72 set:function (newVal) { 70 set:function (newVal) {
73 if (newVal !== this._currentLayerNumber) { 71 if (newVal !== this._currentLayerNumber) {
74 this._currentLayerNumber = newVal; 72 this._currentLayerNumber = newVal;
73 this._setCurrentLayerNumber();
75 } 74 }
76 } 75 }
77 }, 76 },
78 77
79 currentLayerSelected:{ 78 _setCurrentLayerNumber:{
80 value: null 79 value:function(){
80 if (this._boolCacheArrays) {
81 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
82 }
83 }
84 },
85
86 _hashKey:{
87 value:0
88 },
89
90 hashKey:{
91 get:function () {
92 return this._hashKey;
93 },
94 set:function (newVal) {
95 if (newVal !== this._hashKey) {
96 this._hashKey = newVal;
97 this._setHashKey();
98 }
99 }
81 }, 100 },
82 101
83 currentTrackSelected:{ 102 _setHashKey:{
103 value:function(){
104 if (this._boolCacheArrays) {
105 this.application.ninja.currentDocument.hashKey = this.hashKey;
106 }
107 }
108 },
109
110 currentLayerSelected:{
84 value: null 111 value: null
85 }, 112 },
86 113
@@ -104,22 +131,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
104 } 131 }
105 }, 132 },
106 133
107 _arrTracks:{
108 serializable:true,
109 value:[]
110 },
111
112 arrTracks:{
113 serializable:true,
114 get:function () {
115 return this._arrTracks;
116 },
117 set:function (newVal) {
118 this._arrTracks = newVal;
119 this._cacheArrays();
120 }
121 },
122
123 _trackRepetition:{ 134 _trackRepetition:{
124 serializable:true, 135 serializable:true,
125 value:null 136 value:null
@@ -163,6 +174,22 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
163 } 174 }
164 }, 175 },
165 176
177 _breadCrumbContainer:{
178 value:null
179 },
180
181 breadCrumbContainer: {
182 set: function(value) {
183 if(this._breadCrumbContainer !== value) {
184 this._breadCrumbContainer = value;
185 this.LayerBinding(this.application.ninja.currentSelectedContainer);
186 }
187 },
188 get: function() {
189 return this._breadCrumbContainer;
190 }
191 },
192
166 _isLayer:{ 193 _isLayer:{
167 value:false 194 value:false
168 }, 195 },
@@ -181,22 +208,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
181 value:false, 208 value:false,
182 writable:true 209 writable:true
183 }, 210 },
211
184 timeMarkerHolder:{ 212 timeMarkerHolder:{
185 value: null 213 value: null
186 }, 214 },
187 /* === END: Models === */ 215 /* === END: Models === */
188
189 /* === BEGIN: Draw cycle === */ 216 /* === BEGIN: Draw cycle === */
190 prepareForDraw:{ 217 prepareForDraw:{
191 value:function () { 218 value:function () {
192 this.initTimeline(); 219 this.initTimeline();
193 this.eventManager.addEventListener("onOpenDocument", this, false); 220 this.eventManager.addEventListener("onOpenDocument", this, false);
194 this.eventManager.addEventListener("closeDocument", this, false); 221 this.eventManager.addEventListener("closeDocument", this, false);
195 this.eventManager.addEventListener("switchDocument", this, false); 222 this.eventManager.addEventListener("switchDocument", this, false);
196 } 223 }
197 }, 224 },
198 225
199
200 willDraw:{ 226 willDraw:{
201 value:function () { 227 value:function () {
202 if (this._isLayer) { 228 if (this._isLayer) {
@@ -206,19 +232,15 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
206 } 232 }
207 }, 233 },
208 /* === END: Draw cycle === */ 234 /* === END: Draw cycle === */
209
210 /* === BEGIN: Controllers === */ 235 /* === BEGIN: Controllers === */
211
212 // Bind all document-specific events (pass in true to unbind) 236 // Bind all document-specific events (pass in true to unbind)
213 _bindDocumentEvents : { 237 _bindDocumentEvents : {
214 value: function(boolUnbind) { 238 value: function(boolUnbind) {
215 var arrEvents = ["deleteLayerClick", 239 var arrEvents = ["deleteLayerClick",
216 "newLayer", 240 "newLayer",
217 "deleteLayer", 241 "deleteLayer",
218 "layerBinding",
219 "elementAdded", 242 "elementAdded",
220 "elementDeleted", 243 "elementDeleted",
221 "deleteSelection",
222 "selectionChange"], 244 "selectionChange"],
223 i, 245 i,
224 arrEventsLength = arrEvents.length; 246 arrEventsLength = arrEvents.length;
@@ -231,6 +253,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
231 for (i = 0; i < arrEventsLength; i++) { 253 for (i = 0; i < arrEventsLength; i++) {
232 this.eventManager.addEventListener(arrEvents[i], this, false); 254 this.eventManager.addEventListener(arrEvents[i], this, false);
233 } 255 }
256 Object.defineBinding(this, "breadCrumbContainer", {
257 boundObject: this.application.ninja,
258 boundObjectPropertyPath:"currentSelectedContainer",
259 oneway: true
260 });
234 } 261 }
235 } 262 }
236 }, 263 },
@@ -257,9 +284,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
257 value:function () { 284 value:function () {
258 var myIndex; 285 var myIndex;
259 this.drawTimeMarkers(); 286 this.drawTimeMarkers();