From a696dffcc84b4d2719f8fa918676f9575858ca9a Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Thu, 17 May 2012 16:52:16 -0700 Subject: Timeline: Multiselect improvements. New convenience methods. Multiselect drag and drop. --- js/controllers/elements/element-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 20225c61..eecf319e 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -17,7 +17,7 @@ exports.ElementController = Montage.create(Component, { if(selectedLayerIndex === 0) { this.application.ninja.currentSelectedContainer.appendChild(el); } else { - var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0]; + var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.stageElement; element.parentNode.insertBefore(el, element.nextSibling); } } else { -- cgit v1.2.3 From 6c4f58ab9dd2f60d509d3e1c1ba0c94a6995691d Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 18 May 2012 15:05:50 -0700 Subject: Timeline: Fix element insertion to use new TimelinePanel properties and multiselect. Fix Property Panel so changing an ID there will actually change an ID on the element (broken by switch from id to data-montage-id change). --- js/controllers/elements/element-controller.js | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index eecf319e..925fc959 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -11,6 +11,33 @@ exports.ElementController = Montage.create(Component, { addElement: { value: function(el, styles) { + // Updated to use new methods in TimelinePanel. JR. + var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); + console.log("elementcontroller.addElement, insertionIndex = ", insertionIndex); + //debugger; + if (insertionIndex === false) { + this.application.ninja.currentSelectedContainer.appendChild(el); + } else { + if (insertionIndex === 0) { + this.application.ninja.currentSelectedContainer.appendChild(el); + } else { + /* + if (insertionIndex === this.application.ninja.timeline.arrLayers.length-1) { + this.application.ninja.currentSelectedContainer.appendChild(el); + } else { + */ + var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; + element.parentNode.insertBefore(el, element.nextSibling); + //} + } + } + + if(styles) { + this.application.ninja.stylesController.setElementStyles(el, styles); + } + + /* + // Old methods. Kept for reference. Delete if not needed. JR. if(this.application.ninja.timeline.currentLayerSelected) { var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); @@ -27,6 +54,7 @@ exports.ElementController = Montage.create(Component, { if(styles) { this.application.ninja.stylesController.setElementStyles(el, styles); } + */ } }, -- cgit v1.2.3 From e7286bcbd82c944ffe9705d87ff23b9ea29ea7e5 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 18 May 2012 15:22:20 -0700 Subject: Timeline: Bug fixes for deleting elements. --- js/controllers/elements/element-controller.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 925fc959..675176e9 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -13,22 +13,14 @@ exports.ElementController = Montage.create(Component, { value: function(el, styles) { // Updated to use new methods in TimelinePanel. JR. var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); - console.log("elementcontroller.addElement, insertionIndex = ", insertionIndex); - //debugger; if (insertionIndex === false) { this.application.ninja.currentSelectedContainer.appendChild(el); } else { if (insertionIndex === 0) { this.application.ninja.currentSelectedContainer.appendChild(el); } else { - /* - if (insertionIndex === this.application.ninja.timeline.arrLayers.length-1) { - this.application.ninja.currentSelectedContainer.appendChild(el); - } else { - */ - var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; - element.parentNode.insertBefore(el, element.nextSibling); - //} + var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; + element.parentNode.insertBefore(el, element.nextSibling); } } -- cgit v1.2.3 From 82b0c1b8ee197e23fbd5184cbb0522ca76e651c8 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Thu, 31 May 2012 14:27:51 -0700 Subject: Color Chip Signed-off-by: Kruti Shah --- js/controllers/elements/element-controller.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 675176e9..db1d5e49 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -148,7 +148,7 @@ exports.ElementController = Montage.create(Component, { }, setColor: { - value: function(el, color, isFill) { + value: function(el, color, isFill,borderSide) { var mode = color.mode; if(isFill) { @@ -191,8 +191,12 @@ exports.ElementController = Montage.create(Component, { } break; default: - this.setProperty(el, "border-image", "none"); - this.setProperty(el, "border-color", color.color.css); + if(borderSide){ + this.setProperty(el,"border-"+borderSide+"-color",color.color.css); + }else{ + this.setProperty(el, "border-image", "none"); + this.setProperty(el, "border-color", color.color.css); + } if(color.borderInfo) { if(color.borderInfo.borderWidth) { this.setProperty(el, "border-width", color.borderInfo.borderWidth + color.borderInfo.borderUnits); -- cgit v1.2.3 From c1cd060be878d30fda71140dc850b8d1ac68c6ad Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Fri, 8 Jun 2012 11:27:40 -0700 Subject: Color chip in TP Signed-off-by: Kruti Shah --- js/controllers/elements/element-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index db1d5e49..f37a9249 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -108,7 +108,7 @@ exports.ElementController = Montage.create(Component, { } else { // Try getting border color from specific side first if(borderSide) { - color = this.getProperty(el, "border-" + borderSide + "-color"); + color = this.getProperty(el, "border-" + borderSide + "-color",true); image = this.getProperty(el, "border-" + borderSide + "-image"); } -- 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/controllers/elements/element-controller.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index f37a9249..da8afbaa 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -99,9 +99,9 @@ exports.ElementController = Montage.create(Component, { // Return cached value if one exists if(isFill) { - if(el.elementModel.fill) { - return el.elementModel.fill; - } +// if(el.elementModel.fill) { +// return el.elementModel.fill; +// } //TODO: Once logic for color and gradient is established, this needs to be revised color = this.getProperty(el, "background-color"); image = this.getProperty(el, "background-image"); @@ -114,9 +114,9 @@ exports.ElementController = Montage.create(Component, { // If no color was found, look up the shared border color if(!color && !image) { - if(el.elementModel.stroke) { - return el.elementModel.stroke; - } +// if(el.elementModel.stroke) { +// return el.elementModel.stroke; +// } color = this.getProperty(el, "border-color"); image = this.getProperty(el, "border-image"); -- cgit v1.2.3 From f22de35e1ef0624db31263188f764dce0111c352 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 15 Jun 2012 11:56:54 -0700 Subject: Timeline: Replace currentSelectedContainer with new model.domContainer. --- js/controllers/elements/element-controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index a474961a..fcb121ee 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -18,10 +18,10 @@ exports.ElementController = Montage.create(Component, { // Updated to use new methods in TimelinePanel. JR. var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); if (insertionIndex === false) { - this.application.ninja.currentSelectedContainer.appendChild(el); + this.application.ninja.currentDocument.model.domContainer.appendChild(el); } else { if (insertionIndex === 0) { - this.application.ninja.currentSelectedContainer.appendChild(el); + this.application.ninja.currentDocument.model.domContainer.appendChild(el); } else { var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; element.parentNode.insertBefore(el, element.nextSibling); -- cgit v1.2.3 From 022e714cb5d10cd8575ab9907eddfb184a990b66 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 20 Jun 2012 11:32:49 -0700 Subject: remove old method Signed-off-by: Jonathan Duran --- js/controllers/elements/element-controller.js | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'js/controllers/elements/element-controller.js') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index fcb121ee..1e05b09b 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -31,26 +31,6 @@ exports.ElementController = Montage.create(Component, { if(styles) { this.application.ninja.stylesController.setElementStyles(el, styles); } - - /* - // Old methods. Kept for reference. Delete if not needed. JR. - if(this.application.ninja.timeline.currentLayerSelected) { - var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); - - if(selectedLayerIndex === 0) { - this.application.ninja.currentDocument.model.domContainer.appendChild(el); - } else { - var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.stageElement; - element.parentNode.insertBefore(el, element.nextSibling); - } - } else { - this.application.ninja.currentDocument.model.domContainer.appendChild(el); - } - - if(styles) { - this.application.ninja.stylesController.setElementStyles(el, styles); - } - */ } }, -- cgit v1.2.3