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') 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') 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') 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