aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
authorJonathan Duran2012-05-14 10:53:20 -0700
committerJonathan Duran2012-05-14 10:53:20 -0700
commit8c464561e0c55dc5bf67e1e815678e0d07dc4727 (patch)
tree6b2f3f3e15b2da5747c20a9e8e0c9aac44b300ca /js/panels/Timeline
parentc16b2c6674a9170e1ef75a489e876808ba2f6c39 (diff)
downloadninja-8c464561e0c55dc5bf67e1e815678e0d07dc4727.tar.gz
Squashed commit of the following:
commit b23502b8ed6856981d09577d4cf24283e5db8afa Author: Kruti Shah <kruti.shah@motorola.com> Date: Mon May 14 10:48:16 2012 -0700 Removed Debugger Signed-off-by: Kruti Shah <kruti.shah@motorola.com> commit c0b531a074e9cf9a964da0cda496bba8d7453ec1 Author: Kruti Shah <kruti.shah@motorola.com> Date: Fri May 11 13:55:18 2012 -0700 Changing Doc Layer Name Signed-off-by: Kruti Shah <kruti.shah@motorola.com> Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js26
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js21
2 files changed, 33 insertions, 14 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 130dd044..b0f6d220 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -83,13 +83,13 @@ var Layer = exports.Layer = Montage.create(Component, {
83 return this._layerName; 83 return this._layerName;
84 }, 84 },
85 set:function(newVal){ 85 set:function(newVal){
86
87 this._layerEditable.value = newVal; 86 this._layerEditable.value = newVal;
88 this._layerName = newVal; 87 this._layerName = newVal;
89 this.layerData.layerName = newVal; 88 this.layerData.layerName = newVal;
90 if (typeof(this.dynamicLayerName) !== "undefined") { 89 if (typeof(this.dynamicLayerName) !== "undefined") {
91 this.dynamicLayerName.value = newVal; 90 this.dynamicLayerName.value = newVal;
92 } 91 }
92
93 } 93 }
94 }, 94 },
95 _layerID:{ 95 _layerID:{
@@ -485,6 +485,8 @@ var Layer = exports.Layer = Montage.create(Component, {
485 this.element.addEventListener("dragleave", this.handleDragleave.bind(this), false); 485 this.element.addEventListener("dragleave", this.handleDragleave.bind(this), false);
486 this.element.addEventListener("dragstart", this.handleDragstart.bind(this), false); 486 this.element.addEventListener("dragstart", this.handleDragstart.bind(this), false);
487 this.element.addEventListener("drop", this.handleDrop.bind(this), false); 487 this.element.addEventListener("drop", this.handleDrop.bind(this), false);
488
489 this.eventManager.addEventListener("updatedID", this, false);
488 490
489 491
490 492
@@ -668,11 +670,11 @@ var Layer = exports.Layer = Montage.create(Component, {
668 670
669 /* Begin: Event handlers */ 671 /* Begin: Event handlers */
670 handleLayerNameChange: { 672 handleLayerNameChange: {
671 value: function(event) { 673 value: function(event) {
672 this.dynamicLayerName.value = this._layerEditable.value; 674 this.dynamicLayerName.value = this._layerEditable.value;
673 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value;
674 this.needsDraw = true; 675 this.needsDraw = true;
675 this.application.ninja.documentController.activeDocument.needsSave = true; 676 this.application.ninja.documentController.activeDocument.needsSave = true;
677 this.layerData.elementsList[0].setAttribute("id",this.dynamicLayerName.value);
676 } 678 }
677 }, 679 },
678 handleAddStyleClick: { 680 handleAddStyleClick: {
@@ -699,7 +701,6 @@ var Layer = exports.Layer = Montage.create(Component, {
699 } 701 }
700 this.dynamicLayerName.value = newVal; 702 this.dynamicLayerName.value = newVal;
701 this.layerName = newVal; 703 this.layerName = newVal;
702 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal;
703 this.application.ninja.documentController.activeDocument.needsSave = true; 704 this.application.ninja.documentController.activeDocument.needsSave = true;
704 this.needsDraw = true; 705 this.needsDraw = true;
705 } 706 }
@@ -845,7 +846,24 @@ var Layer = exports.Layer = Montage.create(Component, {
845 return e.stack.split("at")[3].split(":")[2]; 846 return e.stack.split("at")[3].split(":")[2];
846 } 847 }
847 } 848 }
849 },
850
851 handleUpdatedID:{
852 value:function(event){
853 var i= this.application.ninja.timeline.arrLayers.length;
854 if(event.detail.id){
855 for(var k=0;k<i;k++){
856 if(this.application.ninja.timeline.arrLayers[k].layerData.layerID=== this.application.ninja.timeline.currentLayerSelected.layerData.layerID){
857 this.application.ninja.timeline.currentLayerSelected.layerData.layerName = event.detail.id;
858 this.application.ninja.timeline.triggerLayerBinding(k);
859 this.needsDraw=true;
860 }
861 }
862
863 }
864 }
848 } 865 }
866
849 /* End: Logging routines */ 867 /* End: Logging routines */
850 868
851}); 869});
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 8859e115..7f4fee89 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -402,7 +402,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
402 } 402 }
403 }, 403 },
404 404
405 draw: { 405 draw:{
406 value: function() { 406 value: function() {
407 407
408 // Drag and Drop: 408 // Drag and Drop:
@@ -568,8 +568,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
568 // Bind all document-specific events (pass in true to unbind) 568 // Bind all document-specific events (pass in true to unbind)
569 _bindDocumentEvents : { 569 _bindDocumentEvents : {
570 value: function(boolUnbind) { 570 value: function(boolUnbind) {
571 var arrEvents = ["deleteLayerClick", 571 var arrEvents = [ "newLayer",
572 "newLayer",
573 "deleteLayer", 572 "deleteLayer",
574 "elementAdded", 573 "elementAdded",
575 "elementsRemoved", 574 "elementsRemoved",
@@ -1014,7 +1013,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1014 1013
1015 // Make up a layer name. 1014 // Make up a layer name.
1016 this.currentLayerNumber = this.currentLayerNumber + 1; 1015 this.currentLayerNumber = this.currentLayerNumber + 1;
1017 newLayerName = "Layer " + this.currentLayerNumber; 1016// newLayerName = "Layer " + this.currentLayerNumber;
1017 newLayerName=" ";
1018 1018
1019 // Possibly currentLayerNumber doesn't correctly reflect the 1019 // Possibly currentLayerNumber doesn't correctly reflect the
1020 // number of layers. Check that. 1020 // number of layers. Check that.
@@ -1074,12 +1074,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1074 var newLayerName, thingToPush = this.createLayerTemplate(); 1074 var newLayerName, thingToPush = this.createLayerTemplate();
1075 1075
1076 this.currentLayerNumber = this.currentLayerNumber + 1; 1076 this.currentLayerNumber = this.currentLayerNumber + 1;
1077 newLayerName = "Layer " + this.currentLayerNumber; 1077// newLayerName = "Layer " + this.currentLayerNumber;
1078 1078
1079 if(ele.dataset.storedLayerName){ 1079// if(ele.dataset.storedLayerName){
1080 newLayerName = ele.dataset.storedLayerName; 1080// newLayerName = ele.dataset.storedLayerName;
1081// }
1082 if(ele.id){
1083 thingToPush.layerData.layerName = ele.id;
1081 } 1084 }
1082 thingToPush.layerData.layerName = newLayerName;
1083 thingToPush.layerData.layerID = this.currentLayerNumber; 1085 thingToPush.layerData.layerID = this.currentLayerNumber;
1084 thingToPush.layerData.layerTag = "<" + ele.nodeName.toLowerCase() + ">"; 1086 thingToPush.layerData.layerTag = "<" + ele.nodeName.toLowerCase() + ">";
1085 thingToPush.parentElement = this.application.ninja.currentSelectedContainer; 1087 thingToPush.parentElement = this.application.ninja.currentSelectedContainer;
@@ -1170,7 +1172,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1170 this.currentLayerSelected.layerData.elementsList = []; 1172 this.currentLayerSelected.layerData.elementsList = [];
1171 } 1173 }
1172 this.currentLayerSelected.layerData.elementsList.push(this.application.ninja.selectedElements[0]); 1174 this.currentLayerSelected.layerData.elementsList.push(this.application.ninja.selectedElements[0]);
1173 this.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.currentLayerSelected.layerData.layerName; 1175// this.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.currentLayerSelected.layerData.layerName;
1174 } 1176 }
1175 }, 1177 },
1176 1178
@@ -1178,7 +1180,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1178 value:function (event) { 1180 value:function (event) {
1179 var deleteElements = event.detail; 1181 var deleteElements = event.detail;
1180 //console.log("TimelinePanel.handleElementsRemoved; event.detail is ", event.detail); 1182 //console.log("TimelinePanel.handleElementsRemoved; event.detail is ", event.detail);
1181 //debugger;
1182 this.deleteLayer(deleteElements); 1183 this.deleteLayer(deleteElements);
1183 } 1184 }
1184 }, 1185 },