aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/PanelContainer/PanelContainer.reel/PanelContainer.js2
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js4
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js46
-rwxr-xr-xjs/panels/properties/content.reel/content.js38
-rwxr-xr-xjs/panels/properties/sections/custom-rows/color-select.reel/color-select.html4
-rwxr-xr-xjs/panels/properties/sections/custom-rows/color-select.reel/color-select.js21
-rwxr-xr-xjs/panels/properties/sections/custom.reel/custom.js5
7 files changed, 92 insertions, 28 deletions
diff --git a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
index 3cbd4369..003724bb 100755
--- a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
+++ b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
@@ -45,7 +45,7 @@ exports.PanelContainer = Montage.create(Component, {
45 }, 45 },
46 46
47 initPanelOrder: { 47 initPanelOrder: {
48 value: ['PropertiesPanel','ColorPanel','ComponentsPanel','ProjectPanel','CSSPanel','MaterialsPanel','PresetsPanel'] 48 value: ['ColorPanel', 'PropertiesPanel','ComponentsPanel','ProjectPanel','CSSPanel','MaterialsPanel','PresetsPanel']
49 }, 49 },
50 50
51 panelOrder: { 51 panelOrder: {
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 6d23453d..ec9555fe 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -795,7 +795,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
795 if(this.currentLayerSelected.elementsList[0]!==undefined){ 795 if(this.currentLayerSelected.elementsList[0]!==undefined){
796 if(this.currentTrackSelected.isTrackAnimated){ 796 if(this.currentTrackSelected.isTrackAnimated){
797 this.application.ninja.stage.clearDrawingCanvas(); 797 this.application.ninja.stage.clearDrawingCanvas();
798 alert("cannot add elements to a layer with animated element");/* check how to clear the canvas*/ 798 console.log("cannot add elements to a layer with animated element");
799 return; 799 return;
800 }else{ 800 }else{
801 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); 801 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
@@ -805,12 +805,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
805 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); 805 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
806 this.currentLayerSelected.elementsList.push(event.detail); 806 this.currentLayerSelected.elementsList.push(event.detail);
807 } 807 }
808
809 } 808 }
810 }, 809 },
811 810
812 handleElementDeleted:{ 811 handleElementDeleted:{
813 value:function (event) { 812 value:function (event) {
813
814 var length; 814 var length;
815 this.deleteElement = event.detail; 815 this.deleteElement = event.detail;
816 length = this.currentLayerSelected.elementsList.length - 1; 816 length = this.currentLayerSelected.elementsList.length - 1;
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index bf97c0fd..f8f4f6b8 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -459,7 +459,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
459 459
460 retrieveStoredTweens:{ 460 retrieveStoredTweens:{
461 value:function () { 461 value:function () {
462 var percentValue, fraction, splitValue,offsetAttribute,topOffSetAttribute,leftOffsetAttribute, i = 0; 462 var percentValue, fraction, splitValue,offsetAttribute,topOffSetAttribute,leftOffsetAttribute
463 var animationTiming,trackTiming,currentMilliSec,currentMilliSecPerPixel,clickPosition,i = 0;
463 464
464 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 465 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
465 this.application.ninja.timeline.arrLayers[selectedIndex].created=true; 466 this.application.ninja.timeline.arrLayers[selectedIndex].created=true;
@@ -467,23 +468,24 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
467 if(this.animatedElement!==undefined){ 468 if(this.animatedElement!==undefined){
468 this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); 469 this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name");
469 if(this.animationName){ 470 if(this.animationName){
470 this.animationDuration = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); 471 animationTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration");
471 this.trackDuration = this.animationDuration.split("s"); 472 trackTiming = animationTiming.split("s");
472 this.currentMilliSec = this.trackDuration[0] * 1000; 473 currentMilliSec = trackTiming[0] * 1000;
473 this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); 474 currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
474 this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; 475 clickPosition = currentMilliSec / currentMilliSecPerPixel;
475 this.nextKeyframe = 0; 476 this.nextKeyframe = 0;
476 477
477 this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); 478 this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document);
478 while (this.currentKeyframeRule[i]) { 479
480 for (i =0; this.currentKeyframeRule[i] ;i++) {
479 var newTween = {}; 481 var newTween = {};
480 482
481 offsetAttribute = this.currentKeyframeRule[i].cssText.split(" "); 483 offsetAttribute = this.currentKeyframeRule[i].cssText.split(" ");
482 topOffSetAttribute = offsetAttribute[3].split("px"); 484 topOffSetAttribute = offsetAttribute[3].split("px");
483 leftOffsetAttribute = offsetAttribute[5].split("px"); 485 leftOffsetAttribute = offsetAttribute[5].split("px");
484 486
485 parseInt(topOffSetAttribute[0]); 487 var tempTopOffset = parseInt(topOffSetAttribute[0]);
486 parseInt(leftOffsetAttribute[0]); 488 var tempLeftOffset =parseInt(leftOffsetAttribute[0]);
487 489
488 if (this.currentKeyframeRule[i].keyText === "0%") { 490 if (this.currentKeyframeRule[i].keyText === "0%") {
489 newTween.spanWidth = 0; 491 newTween.spanWidth = 0;
@@ -492,8 +494,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
492 newTween.tweenID = 0; 494 newTween.tweenID = 0;
493 newTween.spanPosition = 0; 495 newTween.spanPosition = 0;
494 newTween.tweenedProperties = []; 496 newTween.tweenedProperties = [];
495 newTween.tweenedProperties["top"] = topOffSetAttribute[0]; 497 newTween.tweenedProperties["top"] = tempTopOffset;
496 newTween.tweenedProperties["left"] = leftOffsetAttribute[0]; 498 newTween.tweenedProperties["left"] = tempLeftOffset;
497 this.tweens.push(newTween); 499 this.tweens.push(newTween);
498 500
499 } 501 }
@@ -501,30 +503,26 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
501 percentValue = this.currentKeyframeRule[i].keyText; 503 percentValue = this.currentKeyframeRule[i].keyText;
502 splitValue = percentValue.split("%"); 504 splitValue = percentValue.split("%");
503 fraction = splitValue[0] / 100; 505 fraction = splitValue[0] / 100;
504 this.currentMilliSec = fraction * this.trackDuration[0] * 1000; 506 currentMilliSec = fraction * trackTiming[0] * 1000;
505 this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); 507 currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
506 this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; 508 clickPosition = currentMilliSec / currentMilliSecPerPixel;
507 newTween.spanWidth = this.clickPos - this.tweens[this.tweens.length - 1].keyFramePosition; 509 newTween.spanWidth = clickPosition - this.tweens[this.tweens.length - 1].keyFramePosition;
508 newTween.keyFramePosition = this.clickPos; 510 newTween.keyFramePosition = clickPosition;
509 newTween.keyFrameMillisec = this.currentMilliSec; 511 newTween.keyFrameMillisec = currentMilliSec;
510 newTween.tweenID = this.nextKeyframe; 512 newTween.tweenID = this.nextKeyframe;
511 newTween.spanPosition = this.clickPos - newTween.spanWidth; 513 newTween.spanPosition =clickPosition - newTween.spanWidth;
512 newTween.tweenedProperties=[]; 514 newTween.tweenedProperties=[];
513 newTween.tweenedProperties["top"] = topOffSetAttribute[0]; 515 newTween.tweenedProperties["top"] = tempTopOffset;
514 newTween.tweenedProperties["left"] = leftOffsetAttribute[0]; 516 newTween.tweenedProperties["left"] = tempLeftOffset;
515 this.tweens.push(newTween); 517 this.tweens.push(newTween);
516 518
517 519
518 } 520 }
519 i++;
520 this.nextKeyframe += 1; 521 this.nextKeyframe += 1;
521 } 522 }
522 this.isTrackAnimated = true; 523 this.isTrackAnimated = true;
523 } 524 }
524 } 525 }
525 else{
526 return;
527 }
528 } 526 }
529 }, 527 },
530 528
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js
index 8fa33a75..72c02ffd 100755
--- a/js/panels/properties/content.reel/content.js
+++ b/js/panels/properties/content.reel/content.js
@@ -55,6 +55,7 @@ exports.Content = Montage.create(Component, {
55 } 55 }
56 56
57 this.eventManager.addEventListener("openDocument", this, false); 57 this.eventManager.addEventListener("openDocument", this, false);
58 this.eventManager.addEventListener("switchDocument", this, false);
58 } 59 }
59 }, 60 },
60 61
@@ -74,6 +75,21 @@ exports.Content = Montage.create(Component, {
74 } 75 }
75 }, 76 },
76 77
78 handleSwitchDocument: {
79 value: function(){
80 // For now always assume that the stage is selected by default
81 if(this.application.ninja.selectedElements.length === 0) {
82 this.displayStageProperties();
83 }else {
84 if(this.application.ninja.selectedElements.length === 1) {
85 this.displayElementProperties(this.application.ninja.selectedElements[0]._element);