From 648ee61ae84216d0236e0dbc211addc13b2cfa3a Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:52:06 -0700 Subject: Expand tabs --- js/controllers/elements/element-controller.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 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 39efcf0c..646fa455 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -37,21 +37,21 @@ exports.ElementController = Montage.create(Component, { addElement: { value: function(el, styles) { - if (el.getAttribute) el.setAttribute('data-ninja-node', 'true'); - - // Updated to use new methods in TimelinePanel. JR. - var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); - if (insertionIndex === false) { - this.application.ninja.currentDocument.model.domContainer.appendChild(el); - } else { - if (insertionIndex === 0) { - this.application.ninja.currentDocument.model.domContainer.appendChild(el); - } else { + if (el.getAttribute) el.setAttribute('data-ninja-node', 'true'); + + // Updated to use new methods in TimelinePanel. JR. + var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); + if (insertionIndex === false) { + this.application.ninja.currentDocument.model.domContainer.appendChild(el); + } else { + if (insertionIndex === 0) { + 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); - } - } - + } + } + if(styles) { this.application.ninja.stylesController.setElementStyles(el, styles); } -- cgit v1.2.3 From 04343eda8c2f870b0da55cfdc8003c99fe1cc4de Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:53:10 -0700 Subject: Remove trailing spaces --- js/controllers/elements/element-controller.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 646fa455..59ac238c 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -36,9 +36,9 @@ exports.ElementController = Montage.create(Component, { addElement: { value: function(el, styles) { - + if (el.getAttribute) el.setAttribute('data-ninja-node', 'true'); - + // Updated to use new methods in TimelinePanel. JR. var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); if (insertionIndex === false) { @@ -51,7 +51,7 @@ exports.ElementController = Montage.create(Component, { element.parentNode.insertBefore(el, element.nextSibling); } } - + if(styles) { this.application.ninja.stylesController.setElementStyles(el, styles); } @@ -67,7 +67,7 @@ exports.ElementController = Montage.create(Component, { el.parentNode.removeChild(el); } }, - + getProperty: { value: function(el, prop, fallbackOnComputed, isStageElement) { if(el.nodeType !== 3){ -- cgit v1.2.3