diff options
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-x | js/controllers/elements/controller-factory.js | 2 | ||||
-rwxr-xr-x | js/controllers/elements/element-controller.js | 30 | ||||
-rwxr-xr-x | js/controllers/elements/shapes-controller.js | 19 |
3 files changed, 24 insertions, 27 deletions
diff --git a/js/controllers/elements/controller-factory.js b/js/controllers/elements/controller-factory.js index 2bf3eae0..eb8e977c 100755 --- a/js/controllers/elements/controller-factory.js +++ b/js/controllers/elements/controller-factory.js | |||
@@ -33,7 +33,7 @@ var Montage = require("montage/core/core").Montage; | |||
33 | var BodyController = require("js/controllers/elements/body-controller").BodyController, | 33 | var BodyController = require("js/controllers/elements/body-controller").BodyController, |
34 | BlockController = require("js/controllers/elements/block-controller").BlockController, | 34 | BlockController = require("js/controllers/elements/block-controller").BlockController, |
35 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, | 35 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, |
36 | ImageController = require("js/controllers/elements/image-controller").ImageController, | 36 | ImageController = require("js/controllers/elements/image-controller").ImageController, |
37 | VideoController = require("js/controllers/elements/video-controller").VideoController, | 37 | VideoController = require("js/controllers/elements/video-controller").VideoController, |
38 | ComponentController = require("js/controllers/elements/component-controller").ComponentController, | 38 | ComponentController = require("js/controllers/elements/component-controller").ComponentController, |
39 | CanvasController = require("js/controllers/elements/canvas-controller").CanvasController; | 39 | CanvasController = require("js/controllers/elements/canvas-controller").CanvasController; |
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 39efcf0c..59ac238c 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -36,22 +36,22 @@ exports.ElementController = Montage.create(Component, { | |||
36 | 36 | ||
37 | addElement: { | 37 | addElement: { |
38 | value: function(el, styles) { | 38 | value: function(el, styles) { |
39 | 39 | ||
40 | if (el.getAttribute) el.setAttribute('data-ninja-node', 'true'); | 40 | if (el.getAttribute) el.setAttribute('data-ninja-node', 'true'); |
41 | 41 | ||
42 | // Updated to use new methods in TimelinePanel. JR. | 42 | // Updated to use new methods in TimelinePanel. JR. |
43 | var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); | 43 | var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); |
44 | if (insertionIndex === false) { | 44 | if (insertionIndex === false) { |
45 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); | 45 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); |
46 | } else { | 46 | } else { |
47 | if (insertionIndex === 0) { | 47 | if (insertionIndex === 0) { |
48 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); | 48 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); |
49 | } else { | 49 | } else { |
50 | var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; | 50 | var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; |
51 | element.parentNode.insertBefore(el, element.nextSibling); | 51 | element.parentNode.insertBefore(el, element.nextSibling); |
52 | } | 52 | } |
53 | } | 53 | } |
54 | 54 | ||
55 | if(styles) { | 55 | if(styles) { |
56 | this.application.ninja.stylesController.setElementStyles(el, styles); | 56 | this.application.ninja.stylesController.setElementStyles(el, styles); |
57 | } | 57 | } |
@@ -67,7 +67,7 @@ exports.ElementController = Montage.create(Component, { | |||
67 | el.parentNode.removeChild(el); | 67 | el.parentNode.removeChild(el); |
68 | } | 68 | } |
69 | }, | 69 | }, |
70 | 70 | ||
71 | getProperty: { | 71 | getProperty: { |
72 | value: function(el, prop, fallbackOnComputed, isStageElement) { | 72 | value: function(el, prop, fallbackOnComputed, isStageElement) { |
73 | if(el.nodeType !== 3){ | 73 | if(el.nodeType !== 3){ |
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index a0d3c0d6..f3ea5c2b 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -28,7 +28,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||
28 | POSSIBILITY OF SUCH DAMAGE. | 28 | POSSIBILITY OF SUCH DAMAGE. |
29 | </copyright> */ | 29 | </copyright> */ |
30 | 30 | ||
31 | var Montage = require("montage/core/core").Montage, | 31 | var Montage = require("montage/core/core").Montage, |
32 | CanvasController = require("js/controllers/elements/canvas-controller").CanvasController, | 32 | CanvasController = require("js/controllers/elements/canvas-controller").CanvasController, |
33 | njModule = require("js/lib/NJUtils"), | 33 | njModule = require("js/lib/NJUtils"), |
34 | World = require("js/lib/drawing/world").World, | 34 | World = require("js/lib/drawing/world").World, |
@@ -300,7 +300,7 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
300 | return null; | 300 | return null; |
301 | } | 301 | } |
302 | break; | 302 | break; |
303 | 303 | ||
304 | 304 | ||
305 | case "strokeMaterial": | 305 | case "strokeMaterial": |
306 | var sm = el.elementModel.shapeModel.GLGeomObj.getStrokeMaterial(); | 306 | var sm = el.elementModel.shapeModel.GLGeomObj.getStrokeMaterial(); |
@@ -882,15 +882,12 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
882 | value: function(m) | 882 | value: function(m) |
883 | { | 883 | { |
884 | var css, | 884 | var css, |
885 | colorObj; | 885 | colorObj, |
886 | if(m === "Linear Gradient") | 886 | material; |
887 | { | 887 | |
888 | css = "-webkit-gradient(linear, left top, right top, from(rgb(255, 0, 0)), color-stop(0.3, rgb(0, 255, 0)), color-stop(0.6, rgb(0, 0, 255)), to(rgb(0, 255, 255)))"; | 888 | material = MaterialsModel.getMaterial(m); |
889 | } | 889 | |
890 | else if(m === "Radial Gradient") | 890 | css = material.getGradientData(); |
891 | { | ||
892 | css = "-webkit-radial-gradient(50% 50%, ellipse cover, rgb(255, 0, 0) 0%, rgb(0, 255, 0) 30%, rgb(0, 0, 255) 60%, rgb(0, 255, 255) 100%)"; | ||
893 | } | ||
894 | 891 | ||
895 | if(css) | 892 | if(css) |
896 | { | 893 | { |