aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/controllers/elements/element-controller.js13
-rwxr-xr-xjs/mediators/element-mediator.js28
-rw-r--r--js/panels/Timeline/Keyframe.reel/Keyframe.html2
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js43
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.html2
-rw-r--r--js/panels/Timeline/Span.reel/Span.html2
-rw-r--r--js/panels/Timeline/Style.reel/Style.html12
-rw-r--r--js/panels/Timeline/Style.reel/Style.js6
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html60
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js37
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js34
-rw-r--r--js/panels/Timeline/Track.reel/Track.html6
-rw-r--r--js/panels/Timeline/Track.reel/Track.js12
-rw-r--r--js/panels/Timeline/TrackSpacer.reel/TrackSpacer.html4
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.html6
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js5
16 files changed, 112 insertions, 160 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 452d09f1..ea5fe4af 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -11,7 +11,18 @@ exports.ElementController = Montage.create(Component, {
11 11
12 addElement: { 12 addElement: {
13 value: function(el, styles) { 13 value: function(el, styles) {
14 this.application.ninja.currentDocument.documentRoot.appendChild(el); 14 if(this.application.ninja.timeline.currentLayerSelected) {
15 var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID);
16
17 if(selectedLayerIndex === 0) {
18 this.application.ninja.currentDocument.documentRoot.appendChild(el);
19 } else {
20 var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0];
21 element.parentNode.insertBefore(el, element.nextSibling);
22 }
23 } else {
24 this.application.ninja.currentDocument.documentRoot.appendChild(el);
25 }
15 // Nested elements - TODO make sure the CSS is correct before nesting elements 26 // Nested elements - TODO make sure the CSS is correct before nesting elements
16 // this.application.ninja.currentSelectedContainer.appendChild(el); 27 // this.application.ninja.currentSelectedContainer.appendChild(el);
17 if(styles) { 28 if(styles) {
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 919aaec1..06514076 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -514,11 +514,33 @@ exports.ElementMediator = Montage.create(Component, {
514 var str = this.getProperty(el, "-webkit-transform"); 514 var str = this.getProperty(el, "-webkit-transform");
515 return str && str.length; 515 return str && str.length;
516 } 516 }
517 } 517 },
518
519 518
519 reArrangeDOM:{
520 value: function(layersDraggedArray, layerDroppedAfter) {
521 var documentRoot,length;
520 522
523 documentRoot = this.application.ninja.currentDocument.documentRoot;
524 length = layersDraggedArray.length;
521 525
522 //-------------------------------------------------------------------------------------------------------- 526 for(var i=0; documentRoot.children[i]; i++) {
527 if(documentRoot.children[i] === layerDroppedAfter.layerData.elementsList[0]) {
528 if(length >0){
529 documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0], documentRoot.children[i]);
530 }
523 531
532 /* Will require for Multiple Drag n Drop */
533 //length = length-1;
534 //index = i;
535 //if(length>0) {
536 //while(layersDraggedArray[length]) {
537 //documentRoot.children[index].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0],documentRoot.children[k].nextSibling);
538 //length--;
539 //index++;
540 //}
541 //}
542 }
543 }
544 }
545 }
524}); \ No newline at end of file 546}); \ No newline at end of file
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.html b/js/panels/Timeline/Keyframe.reel/Keyframe.html
index 6f9a6d05..4b029874 100644
--- a/js/panels/Timeline/Keyframe.reel/Keyframe.html
+++ b/js/panels/Timeline/Keyframe.reel/Keyframe.html
@@ -22,7 +22,7 @@
22 </head> 22 </head>
23 <body> 23 <body>
24 24
25 <div id="keyframespace" class="tween_keyframe"> 25 <div data-montage-id="keyframespace" class="tween_keyframe">
26 </div> 26 </div>
27 27
28 </body> 28 </body>
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index f2e20d41..b23da749 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -36,13 +36,10 @@ var Layer = exports.Layer = Montage.create(Component, {
36 36
37 /* Style models: the array of styles, and the repetition that uses them */ 37 /* Style models: the array of styles, and the repetition that uses them */
38 _arrLayerStyles : { 38 _arrLayerStyles : {
39 serializable: true,
40 enumerable: true,
41 value: [] 39 value: []
42 }, 40 },
43 arrLayerStyles : { 41 arrLayerStyles : {
44 serializable: true, 42 serializable: true,
45 enumerable: true,
46 get: function() { 43 get: function() {
47 return this._arrLayerStyles; 44 return this._arrLayerStyles;
48 }, 45 },
@@ -142,8 +139,7 @@ var Layer = exports.Layer = Montage.create(Component, {
142 139
143 /* Position and Transform hottext values */ 140 /* Position and Transform hottext values */
144 _dtextPositionX : { 141 _dtextPositionX : {
145 value:null, 142 value:null
146 serializable: true
147 }, 143 },
148 144
149 dtextPositionX:{ 145 dtextPositionX:{
@@ -161,8 +157,7 @@ var Layer = exports.Layer = Montage.create(Component, {
161 }, 157 },
162 158
163 _dtextPositionY : { 159 _dtextPositionY : {
164 value:null, 160 value:null
165 serializable: true
166 }, 161 },
167 162
168 dtextPositionY:{ 163 dtextPositionY:{
@@ -180,8 +175,7 @@ var Layer = exports.Layer = Montage.create(Component, {
180 }, 175 },
181 176
182 _dtextScaleX : { 177 _dtextScaleX : {
183 value:null, 178 value:null
184 serializable: true
185 }, 179 },
186 180
187 dtextScaleX:{ 181 dtextScaleX:{
@@ -199,8 +193,7 @@ var Layer = exports.Layer = Montage.create(Component, {
199 }, 193 },
200 194
201 _dtextScaleY : { 195 _dtextScaleY : {
202 value:null, 196 value:null
203 serializable: true
204 }, 197 },
205 198
206 dtextScaleY:{ 199 dtextScaleY:{
@@ -218,8 +211,7 @@ var Layer = exports.Layer = Montage.create(Component, {
218 }, 211 },
219 212
220 _dtextSkewX : { 213 _dtextSkewX : {
221 value:null, 214 value:null
222 serializable: true
223 }, 215 },
224 216
225 dtextSkewX:{ 217 dtextSkewX:{
@@ -237,8 +229,7 @@ var Layer = exports.Layer = Montage.create(Component, {
237 }, 229 },
238 230
239 _dtextSkewY : { 231 _dtextSkewY : {
240 value:null, 232 value:null
241 serializable: true
242 }, 233 },
243 234
244 dtextSkewY:{ 235 dtextSkewY:{
@@ -256,8 +247,7 @@ var Layer = exports.Layer = Montage.create(Component, {
256 }, 247 },
257 248
258 _dtextRotate : { 249 _dtextRotate : {
259 value:null, 250 value:null
260 serializable: true
261 }, 251 },
262 252
263 dtextRotate:{ 253 dtextRotate:{
@@ -276,10 +266,7 @@ var Layer = exports.Layer = Montage.create(Component, {
276 266
277 /* isSelected: whether or not the layer is currently selected. */ 267 /* isSelected: whether or not the layer is currently selected. */
278 _isSelected:{ 268 _isSelected:{
279 value: false, 269 value: false
280 writable: true,
281 serializable: true,
282 enumerable: false
283 }, 270 },
284 271
285 isSelected:{ 272 isSelected:{
@@ -319,9 +306,7 @@ var Layer = exports.Layer = Montage.create(Component, {
319 306
320 307
321 _isAnimated:{ 308 _isAnimated:{
322 value: false, 309 value: false
323 writable: true,
324 enumerable: false
325 }, 310