aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements/element-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/elements/element-controller.js')
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/element-controller.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 65d26bdd..46e82ace 100644..100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -12,6 +12,9 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
12 addElement: { 12 addElement: {
13 value: function(el, styles) { 13 value: function(el, styles) {
14 this.application.ninja.currentDocument.documentRoot.appendChild(el); 14 this.application.ninja.currentDocument.documentRoot.appendChild(el);
15 // Nested elements -
16 // TODO make sure the CSS is correct before nesting elements
17 // this.application.ninja.currentSelectedContainer.appendChild(el);
15 this.application.ninja.stylesController.setElementStyles(el, styles); 18 this.application.ninja.stylesController.setElementStyles(el, styles);
16 } 19 }
17 }, 20 },
@@ -115,6 +118,7 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
115 } 118 }
116 else 119 else
117 { 120 {
121 // TODO - Need to update border style and width also
118 el.elementModel.stroke = colorObj; 122 el.elementModel.stroke = colorObj;
119 } 123 }
120 124
@@ -159,10 +163,22 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
159 case 'gradient': 163 case 'gradient':
160 this.setProperty(el, "border-image", color.color.css); 164 this.setProperty(el, "border-image", color.color.css);
161 this.setProperty(el, "border-color", "none"); 165 this.setProperty(el, "border-color", "none");
166 if(color.borderInfo)
167 {
168 this.setProperty(el, "border-width", color.borderInfo.borderWidth +
169 color.borderInfo.borderUnits);
170 this.setProperty(el, "border-style", color.borderInfo.borderStyle);
171 }
162 break; 172 break;
163 default: 173 default:
164 this.setProperty(el, "border-image", "none"); 174 this.setProperty(el, "border-image", "none");
165 this.setProperty(el, "border-color", color.color.css); 175 this.setProperty(el, "border-color", color.color.css);
176 if(color.borderInfo)
177 {
178 this.setProperty(el, "border-width", color.borderInfo.borderWidth +
179 color.borderInfo.borderUnits);
180 this.setProperty(el, "border-style", color.borderInfo.borderStyle);
181 }
166 } 182 }
167 } 183 }
168 el.elementModel.stroke = color; 184 el.elementModel.stroke = color;