From f1387bc995766b8d941f93e605a91c49c8931645 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Tue, 22 May 2012 10:28:41 -0700 Subject: Layer Control Signed-off-by: Kruti Shah --- js/panels/Timeline/Layer.reel/Layer.js | 142 +++++++++++++++++++++++++++++---- 1 file changed, 125 insertions(+), 17 deletions(-) (limited to 'js/panels/Timeline/Layer.reel/Layer.js') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index b0f6d220..2df11f18 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -12,6 +12,7 @@ var LayerStyle = require("js/panels/Timeline/Style.reel").LayerStyle; var DynamicText = require("montage/ui/dynamic-text.reel").DynamicText; var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager; var nj = require("js/lib/NJUtils").NJUtils; +var ElementsMediator = require("js/mediators/element-mediator").ElementMediator; var Layer = exports.Layer = Montage.create(Component, { @@ -162,7 +163,6 @@ var Layer = exports.Layer = Montage.create(Component, { this._dtextPositionX = value; this.layerData.dtextPositionX = value; } - } }, @@ -487,11 +487,36 @@ var Layer = exports.Layer = Montage.create(Component, { this.element.addEventListener("drop", this.handleDrop.bind(this), false); this.eventManager.addEventListener("updatedID", this, false); - + this.eventManager.addEventListener("elementChange",this,false); + + this.leftControl.identifier = "left"; + this.leftControl.addEventListener("changing",this,false); + this.leftControl.addEventListener("change",this,false); + + this.topControl.identifier = "top"; + this.topControl.addEventListener("changing",this,false); + this.topControl.addEventListener("change",this,false); + + this.widthControl.identifier = "width"; + this.widthControl.addEventListener("changing",this,false); + this.widthControl.addEventListener("change",this,false); + this.heightControl.identifier = "height"; + this.heightControl.addEventListener("changing",this,false); + this.heightControl.addEventListener("change",this,false); + + el=this.layerData.elementsList[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")); + +// this.eventManager.addEventListener("changing",this,false); } }, + draw: { value: function() { if (this.isSelected) { @@ -582,6 +607,7 @@ var Layer = exports.Layer = Montage.create(Component, { newStyle.ruleTweener = false; newStyle.isSelected = false; this.arrLayerStyles.push(newStyle); + console.log(newStyle.editorValue) // Set up the event info and dispatch the event this.styleCounter += 1; @@ -589,6 +615,7 @@ var Layer = exports.Layer = Montage.create(Component, { defaultEventManager.dispatchEvent(newEvent); } }, + deleteStyle : { value: function() { var newEvent = document.createEvent("CustomEvent"), @@ -816,6 +843,100 @@ var Layer = exports.Layer = Montage.create(Component, { return false; } }, + + handleLeftChange:{ + value:function(){ + this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "left", [this.dtextPositionX + "px"] , "Change", "timeline"); + } + }, + + handleTopChange:{ + value:function(){ + this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "top", [this.dtextPositionY + "px"] , "Change", "timeline"); + } + }, + + handleWidthChange:{ + value:function(){ + this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "width", [this.dtextScaleX + "px"] , "Change", "timeline"); + } + }, + + handleHeightChange:{ + value:function(){ + this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "height", [this.dtextScaleY + "px"] , "Change", "timeline"); + } + }, + + handleLeftChanging:{ + value:function(){ + this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "left", [this.dtextPositionX + "px"] , "Changing", "timeline"); + } + }, + + handleTopChanging:{ + value:function(){ + this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "top", [this.dtextPositionY + "px"] , "Changing", "timeline"); + } + }, + + handleWidthChanging:{ + value:function(){ + this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); + } + }, + + handleHeightChanging:{ + value:function(){ + this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); + } + }, + + + handleElementChange:{ + value:function(event){ + var el = this.layerData.elementsList[0]; + var length = this.arrLayerStyles.length , i; + + if(event.detail.source && event.detail.source!== "timeline"){ + 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 --- js/panels/Timeline/Layer.reel/Layer.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/panels/Timeline/Layer.reel/Layer.js') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 77db9b64..a96b206f 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -625,6 +625,7 @@ var Layer = exports.Layer = Montage.create(Component, { newStyle.editorProperty = styleProperty; newEvent.layerEventType = "restoreStyle"; newEvent.trackEditorProperty = styleProperty; + newEvent.trackEditorProperty = styleProperty; } newStyle.editorValue = ""; newStyle.ruleTweener = false; @@ -744,6 +745,7 @@ var Layer = exports.Layer = Montage.create(Component, { this.triggerOutgoingBinding(); this.addStyle(); + } }, handleDeleteStyleClick: { -- cgit v1.2.3 From 2390c512a501755d0b0adf429123e0fe7f34bb77 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Fri, 1 Jun 2012 10:58:43 -0700 Subject: Layer Controls Signed-off-by: Kruti Shah --- js/panels/Timeline/Layer.reel/Layer.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'js/panels/Timeline/Layer.reel/Layer.js') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index a96b206f..cbc001be 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -891,56 +891,56 @@ var Layer = exports.Layer = Montage.create(Component, { handleLeftChange:{ value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "left", [this.dtextPositionX + "px"] , "Change", "timeline"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.dtextPositionX + "px"] , "Change", "timeline"); } }, handleTopChange:{ value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "top", [this.dtextPositionY + "px"] , "Change", "timeline"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.dtextPositionY + "px"] , "Change", "timeline"); } }, handleWidthChange:{ value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "width", [this.dtextScaleX + "px"] , "Change", "timeline"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "timeline"); } }, handleHeightChange:{ value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "height", [this.dtextScaleY + "px"] , "Change", "timeline"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline"); } }, handleLeftChanging:{ value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "left", [this.dtextPositionX + "px"] , "Changing", "timeline"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.dtextPositionX + "px"] , "Changing", "timeline"); } }, handleTopChanging:{ value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "top", [this.dtextPositionY + "px"] , "Changing", "timeline"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.dtextPositionY + "px"] , "Changing", "timeline"); } }, handleWidthChanging:{ value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); } }, handleHeightChanging:{ value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); + this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); } }, handleElementChange:{ value:function(event){ - var el = this.layerData.elementsList[0]; + var el =this.layerData.stageElement; var length = this.arrLayerStyles.length , i; if(event.detail.source && event.detail.source!== "timeline"){ -- cgit v1.2.3 From 07701de29866c6d792257d1e3c39cd1592ee97db Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Fri, 1 Jun 2012 14:09:56 -0700 Subject: LayerControl Signed-off-by: Kruti Shah --- js/panels/Timeline/Layer.reel/Layer.js | 43 +++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) (limited to 'js/panels/Timeline/Layer.reel/Layer.js') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index cbc001be..e01e5b75 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -524,6 +524,32 @@ var Layer = exports.Layer = Montage.create(Component, { this.element.addEventListener("dragleave", this.handleDragleave.bind(this), false); this.element.addEventListener("dragstart", this.handleDragstart.bind(this), false); this.element.addEventListener("drop", this.handleDrop.bind(this), false); + + this.eventManager.addEventListener("elementChange",this,false); + + this.leftControl.identifier = "left"; + this.leftControl.addEventListener("changing",this,false); + this.leftControl.addEventListener("change",this,false); + + this.topControl.identifier = "top"; + this.topControl.addEventListener("changing",this,false); + this.topControl.addEventListener("change",this,false); + + this.widthControl.identifier = "width"; + this.widthControl.addEventListener("changing",this,false); + this.widthControl.addEventListener("change",this,false); + + this.heightControl.identifier = "height"; + this.heightControl.addEventListener("changing",this,false); + this.heightControl.addEventListener("change",this,false); + + el=this.layerData.stageElement; + debugger; + + 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")); } }, @@ -891,19 +917,20 @@ var Layer = exports.Layer = Montage.create(Component, { handleLeftChange:{ value:function(){ - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.dtextPositionX + "px"] , "Change", "timeline"); + debugger; + this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "left", [this.dtextPositionX + "px"] , "Change", "timeline"); } }, handleTopChange:{ value:function(){ - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.dtextPositionY + "px"] , "Change", "timeline"); + this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "top", [this.dtextPositionY + "px"] , "Change", "timeline"); } }, handleWidthChange:{ value:function(){ - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "timeline"); + this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "width", [this.dtextScaleX + "px"] , "Change", "timeline"); } }, @@ -915,25 +942,25 @@ var Layer = exports.Layer = Montage.create(Component, { handleLeftChanging:{ value:function(){ - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.dtextPositionX + "px"] , "Changing", "timeline"); + this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "left", [this.dtextPositionX + "px"] , "Changing", "timeline"); } }, handleTopChanging:{ value:function(){ - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.dtextPositionY + "px"] , "Changing", "timeline"); + this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "top", [this.dtextPositionY + "px"] , "Changing", "timeline"); } }, handleWidthChanging:{ value:function(){ - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); + this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); } }, handleHeightChanging:{ value:function(){ - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); + this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); } }, @@ -1012,7 +1039,7 @@ var Layer = exports.Layer = Montage.create(Component, { return e.stack.split("at")[3].split(":")[2]; } } - }, + } /* End: Logging routines */ }); -- cgit v1.2.3 From 10620ff1a9b42528d84f2c6cc4f64a1790a0d8b7 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Mon, 4 Jun 2012 10:13:30 -0700 Subject: LC Signed-off-by: Kruti Shah --- js/panels/Timeline/Layer.reel/Layer.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'js/panels/Timeline/Layer.reel/Layer.js') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index e01e5b75..da9845d6 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -543,13 +543,13 @@ var Layer = exports.Layer = Montage.create(Component, { this.heightControl.addEventListener("changing",this,false); this.heightControl.addEventListener("change",this,false); - el=this.layerData.stageElement; - debugger; - - 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")); +// el=this.layerData.stageElement; +// debugger; +// +// 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")); } }, @@ -916,7 +916,7 @@ var Layer = exports.Layer = Montage.create(Component, { }, handleLeftChange:{ - value:function(){ + value:function(event){ debugger; this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "left", [this.dtextPositionX + "px"] , "Change", "timeline"); } @@ -1003,11 +1003,6 @@ var Layer = exports.Layer = Montage.create(Component, { } }, - handleChanging:{ - value:function(){ - console.log("in layer.js") - } - }, /* End: Event handlers */ -- cgit v1.2.3 From 8986b9f78174b10790ad00e5a28122cb0879e5e3 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Thu, 7 Jun 2012 21:22:41 -0700 Subject: Sub property Signed-off-by: Kruti Shah --- js/panels/Timeline/Layer.reel/Layer.js | 127 ++++++++++++++++++++++++--------- 1 file changed, 95 insertions(+), 32 deletions(-) (limited to 'js/panels/Timeline/Layer.reel/Layer.js') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index da9845d6..23ba1ef9 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -543,13 +543,11 @@ var Layer = exports.Layer = Montage.create(Component, { this.heightControl.addEventListener("changing",this,false); this.heightControl.addEventListener("change",this,false); -// el=this.layerData.stageElement; -// debugger; -// -// 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")); + el=this.layerData.stageElement; + 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")); } }, @@ -656,6 +654,7 @@ var Layer = exports.Layer = Montage.create(Component, { newStyle.editorValue = ""; newStyle.ruleTweener = false; newStyle.isSelected = false; + newStyle.abcelement = ""; this.arrLayerStyles.push(newStyle); // Set up the event info and dispatch the event @@ -915,52 +914,107 @@ var Layer = exports.Layer = Montage.create(Component, { } }, - handleLeftChange:{ - value:function(event){ - debugger; - this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "left", [this.dtextPositionX + "px"] , "Change", "timeline"); + handleLeftChange: { + value: function(event) { + var prevPosition; + 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.savedPosition = null; + } + + } } }, - handleTopChange:{ - value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "top", [this.dtextPositionY + "px"] , "Change", "timeline"); + handleTopChange: { + value: function(event) { + var prevPosition; + if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){ + 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.savedPosition = null; + } + } } }, handleWidthChange:{ - value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "width", [this.dtextScaleX + "px"] , "Change", "timeline"); + value: function(event) { + var prevPosition; + if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){ + 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.savedPosition = null; + } + } } }, handleHeightChange:{ - value:function(){ - this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline"); + value: function(event) { + var prevPosition; + if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){ + 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.savedPosition = null; + } + } } }, - handleLeftChanging:{ - value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "left", [this.dtextPositionX + "px"] , "Changing", "timeline"); + 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"); + } + } + } }, - handleTopChanging:{ - value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "top", [this.dtextPositionY + "px"] , "Changing", "timeline"); + handleTopChanging: { + value: function(event) { + 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"); + } + } + } }, handleWidthChanging:{ - value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); + value: function(event) { + 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"); + } + } + } }, handleHeightChanging:{ - value:function(){ - this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); + value: function(event) { + 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"); + } + } + } }, @@ -970,20 +1024,29 @@ var Layer = exports.Layer = Montage.create(Component, { var el =this.layerData.stageElement; var length = this.arrLayerStyles.length , i; - if(event.detail.source && event.detail.source!== "timeline"){ 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 --- js/panels/Timeline/Layer.reel/Layer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/panels/Timeline/Layer.reel/Layer.js') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 3fc5a3e1..acc0567c 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -601,7 +601,7 @@ var Layer = exports.Layer = Montage.create(Component, { } }, addStyle : { - value: function(styleProperty) { + value: function(styleProperty, existingRule) { // Add a new style rule. It should be added above the currently selected rule, // Or at the end, if no rule is selected. @@ -630,6 +630,9 @@ var Layer = exports.Layer = Montage.create(Component, { newStyle.editorProperty = styleProperty; newEvent.layerEventType = "restoreStyle"; newEvent.trackEditorProperty = styleProperty; + if(existingRule){ + newEvent.existingRule = existingRule; + } } newStyle.editorValue = ""; newStyle.ruleTweener = false; -- cgit v1.2.3 From 03478f396977973f95977cf21c98bf6a2fa26721 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 12 Jun 2012 11:18:43 -0700 Subject: montage v10 serialization updates for timeline Signed-off-by: Jonathan Duran Conflicts: js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js Signed-off-by: Jonathan Duran --- js/panels/Timeline/Layer.reel/Layer.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js/panels/Timeline/Layer.reel/Layer.js') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index acc0567c..f81d8b09 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -348,6 +348,19 @@ var Layer = exports.Layer = Montage.create(Component, { _layerEditable : { value: false }, + + _dynamicLayerName:{ + value:true + }, + dynamicLayerName:{ + serializable:true, + get:function () { + return this._dynamicLayerName; + }, + set:function (newVal) { + this._dynamicLayerName = newVal; + } + }, // Are the various collapsers collapsed or not _isMainCollapsed : { -- cgit v1.2.3 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/Layer.reel/Layer.js | 122 +++++++++++++++++++++++++++------ 1 file changed, 100 insertions(+), 22 deletions(-) (limited to 'js/panels/Timeline/Layer.reel/Layer.js') 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