From bedb38e14887b29eae3cdf1c8d435259c920257c Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Tue, 12 Jun 2012 13:05:12 -0700 Subject: Sub Props Signed-off-by: Kruti Shah --- js/panels/Timeline/Keyframe.reel/Keyframe.js | 5 +- js/panels/Timeline/Layer.reel/Layer.html | 4 +- js/panels/Timeline/Layer.reel/Layer.js | 122 ++++++++++++++++++++++----- js/panels/Timeline/Style.reel/Style.js | 25 +++--- js/panels/Timeline/Tween.reel/Tween.js | 3 +- 5 files changed, 121 insertions(+), 38 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index c8255cc0..f450dd8a 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js @@ -60,6 +60,7 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { if(this.isSelected){ this.element.classList.add("keyframeSelected"); this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; + console.log(this.application.ninja.timeline.selectedStyle) }else{ this.element.classList.remove("keyframeSelected"); this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty); @@ -70,17 +71,17 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { deselectKeyframe:{ value:function(){ - debugger; this.isSelected=false; this.element.style.left = (this.position - 5) + "px"; + this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty) } }, selectKeyframe:{ value:function(){ - debugger; this.isSelected=true; this.element.style.left = (this.position - 6) + "px"; + this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty this.parentComponent.selectTween(); } }, diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html index fe3f49d2..3648cbbb 100644 --- a/js/panels/Timeline/Layer.reel/Layer.html +++ b/js/panels/Timeline/Layer.reel/Layer.html @@ -111,9 +111,9 @@ "boundObjectPropertyPath" : "objectAtCurrentIteration.ruleTweener", "oneway" : false }, - "abcelement" : { + "colorelement" : { "boundObject" : {"@": "repetition1"}, - "boundObjectPropertyPath" : "objectAtCurrentIteration.abcelement", + "boundObjectPropertyPath" : "objectAtCurrentIteration.colorelement", "oneway" : false } } diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 23ba1ef9..629b118c 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -654,7 +654,7 @@ var Layer = exports.Layer = Montage.create(Component, { newStyle.editorValue = ""; newStyle.ruleTweener = false; newStyle.isSelected = false; - newStyle.abcelement = ""; + newStyle.colorelement = ""; this.arrLayerStyles.push(newStyle); // Set up the event info and dispatch the event @@ -920,7 +920,7 @@ var Layer = exports.Layer = Montage.create(Component, { if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ if(!event.wasSetByCode) { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "pi", prevPosition); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "timeline", prevPosition); this.savedPosition = null; } @@ -935,7 +935,7 @@ var Layer = exports.Layer = Montage.create(Component, { if(!event.wasSetByCode) { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "pi", prevPosition); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "timeline", prevPosition); this.savedPosition = null; } } @@ -949,7 +949,7 @@ var Layer = exports.Layer = Montage.create(Component, { if(!event.wasSetByCode) { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "pi", prevPosition); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "timeline", prevPosition); this.savedPosition = null; } } @@ -963,7 +963,7 @@ var Layer = exports.Layer = Montage.create(Component, { if(!event.wasSetByCode) { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "pi", prevPosition); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline", prevPosition); this.savedPosition = null; } } @@ -972,10 +972,11 @@ var Layer = exports.Layer = Montage.create(Component, { handleLeftChanging: { value: function(event) { + if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ if(!event.wasSetByCode) { if(!this.savedPosition) this.savedPosition = this.leftPosition; - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "pi"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "timeline"); } } @@ -987,7 +988,7 @@ var Layer = exports.Layer = Montage.create(Component, { if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){ if(!event.wasSetByCode) { if(!this.savedPosition) this.savedPosition = this.topPosition; - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "pi"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "timeline"); } } @@ -999,7 +1000,7 @@ var Layer = exports.Layer = Montage.create(Component, { if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){ if(!event.wasSetByCode) { if(!this.savedPosition) this.savedPosition = this.dtextScaleX; - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "pi"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); } } @@ -1011,7 +1012,7 @@ var Layer = exports.Layer = Montage.create(Component, { if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){ if(!event.wasSetByCode) { if(!this.savedPosition) this.savedPosition = this.dtextScaleY; - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "pi"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); } } @@ -1022,33 +1023,110 @@ var Layer = exports.Layer = Montage.create(Component, { handleElementChange:{ value:function(event){ var el =this.layerData.stageElement; - var length = this.arrLayerStyles.length , i; + var length = this.arrLayerStyles.length , i , k=0; this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left")); this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top")); this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height")); this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width")); + for(i=0; i