aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/document-controller.js4
-rwxr-xr-xjs/controllers/elements/controller-factory.js2
-rwxr-xr-xjs/controllers/elements/element-controller.js7
-rwxr-xr-xjs/controllers/elements/shapes-controller.js2
-rwxr-xr-xjs/controllers/styles-controller.js2
5 files changed, 7 insertions, 10 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 6d11bd0e..c6bf4c6b 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -427,10 +427,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
427 427
428 closeDocument: { 428 closeDocument: {
429 value: function(id) { 429 value: function(id) {
430 if(this.activeDocument.needsSave === true){
431 //if file dirty then alert user to save
432 }
433
434 var doc = this._findDocumentByUUID(id); 430 var doc = this._findDocumentByUUID(id);
435 431
436 var closeDocumentIndex = this._findIndexByUUID(id); 432 var closeDocumentIndex = this._findIndexByUUID(id);
diff --git a/js/controllers/elements/controller-factory.js b/js/controllers/elements/controller-factory.js
index 1bbbbce0..3ac3fe14 100755
--- a/js/controllers/elements/controller-factory.js
+++ b/js/controllers/elements/controller-factory.js
@@ -42,6 +42,8 @@ exports.ControllerFactory = Montage.create(Montage, {
42 return ImageController; 42 return ImageController;
43 } else if(value.indexOf("video") !== -1) { 43 } else if(value.indexOf("video") !== -1) {
44 return VideoController; 44 return VideoController;
45 } else {
46 return BlockController;
45 } 47 }
46 } catch (err) { 48 } catch (err) {
47 console.log("Could not create Controller Factory " + err); 49 console.log("Could not create Controller Factory " + err);
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index ea5fe4af..20225c61 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -15,16 +15,15 @@ exports.ElementController = Montage.create(Component, {
15 var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); 15 var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID);
16 16
17 if(selectedLayerIndex === 0) { 17 if(selectedLayerIndex === 0) {
18 this.application.ninja.currentDocument.documentRoot.appendChild(el); 18 this.application.ninja.currentSelectedContainer.appendChild(el);
19 } else { 19 } else {
20 var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0]; 20 var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0];
21 element.parentNode.insertBefore(el, element.nextSibling); 21 element.parentNode.insertBefore(el, element.nextSibling);
22 } 22 }
23 } else { 23 } else {
24 this.application.ninja.currentDocument.documentRoot.appendChild(el); 24 this.application.ninja.currentSelectedContainer.appendChild(el);
25 } 25 }
26 // Nested elements - TODO make sure the CSS is correct before nesting elements 26
27 // this.application.ninja.currentSelectedContainer.appendChild(el);
28 if(styles) { 27 if(styles) {
29 this.application.ninja.stylesController.setElementStyles(el, styles); 28 this.application.ninja.stylesController.setElementStyles(el, styles);
30 } 29 }
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 8d7b74f0..e9a5f865 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -129,7 +129,7 @@ exports.ShapesController = Montage.create(CanvasController, {
129 el.elementModel.shapeModel.GLWorld.render(); 129 el.elementModel.shapeModel.GLWorld.render();
130 break; 130 break;
131 case "useWebGl": 131 case "useWebGl":
132 canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true); 132 canvas = njModule.NJUtils.make("canvas", el.className, this.application.ninja.currentDocument);
133 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom()); 133 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom());
134 canvas.width = el.width; 134 canvas.width = el.width;
135 canvas.height = el.height; 135 canvas.height = el.height;
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js
index ec4314f9..647c0870 100755
--- a/js/controllers/styles-controller.js
+++ b/js/controllers/styles-controller.js
@@ -1102,7 +1102,7 @@ var stylesController = exports.StylesController = Montage.create(Component, {
1102 ///// The dominant rule might not have the style property defined - why? 1102 ///// The dominant rule might not have the style property defined - why?
1103 ///// If no rules have the property defined, we can use the 1103 ///// If no rules have the property defined, we can use the
1104 ///// most-specific single-target rule as the dominant rule (for setting styles) 1104 ///// most-specific single-target rule as the dominant rule (for setting styles)
1105 return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property); 1105 return (element.ownerDocument.defaultView ? element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property) : null);
1106 } 1106 }
1107 1107
1108 return value; 1108 return value;