aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-07 10:51:26 -0700
committerValerio Virgillito2012-06-07 10:51:26 -0700
commitb75fe9369f7caec0351d298f7106c8d59572b440 (patch)
tree8f2f2db6097104e44c8d87e11466d1f3124c7f3a /js/panels
parent47e0e1f047e83b71c3f86812a45d33904201cc7a (diff)
parent6442dcc0cc4088d28558a9c121c6a91cba3ff078 (diff)
downloadninja-b75fe9369f7caec0351d298f7106c8d59572b440.tar.gz
Merge pull request #275 from mencio/element-model-fixes
Element model fixes and selection fixes
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/components-panel.reel/components-panel.js22
1 files changed, 0 insertions, 22 deletions
diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js
index 0b453c4a..e6b7a6e3 100755
--- a/js/panels/components-panel.reel/components-panel.js
+++ b/js/panels/components-panel.reel/components-panel.js
@@ -292,8 +292,6 @@ exports.ComponentsPanel = Montage.create(Component, {
292 } 292 }
293 } 293 }
294 294
295// that.application.ninja.currentDocument.model.setComponentInstance(instance, element);
296
297 //that.application.ninja.elementMediator.addElements(element, styles); 295 //that.application.ninja.elementMediator.addElements(element, styles);
298 ElementController.addElement(element, styles); 296 ElementController.addElement(element, styles);
299 }); 297 });
@@ -303,11 +301,6 @@ exports.ComponentsPanel = Montage.create(Component, {
303 301
304 componentInstanceOnFirstDraw: { 302 componentInstanceOnFirstDraw: {
305 value: function(instance) { 303 value: function(instance) {
306 // Temporary hack until the element model rework goes into place
307 // TODO: Remove this once we have the element model define property code in place.
308 if(!instance.element.elementModel) {
309 this.application.njUtils.makeModelFromElement(instance.element);
310 }
311 this.application.ninja.elementMediator.addElements(instance.element); 304 this.application.ninja.elementMediator.addElements(instance.element);
312 } 305 }
313 }, 306 },
@@ -319,75 +312,60 @@ exports.ComponentsPanel = Montage.create(Component, {
319 switch(name) { 312 switch(name) {
320 case "anchor": 313 case "anchor":
321 el = document.application.njUtils.make("a", null, this.application.ninja.currentDocument); 314 el = document.application.njUtils.make("a", null, this.application.ninja.currentDocument);
322 document.application.njUtils.createModelForComponent(el, "Anchor");
323 el.setAttribute("href", "http://www.motorola.com"); 315 el.setAttribute("href", "http://www.motorola.com");
324 el.innerHTML = "link"; 316 el.innerHTML = "link";
325 break; 317 break;
326 case "button": 318 case "button":
327 el = document.application.njUtils.make(name, null, this.application.ninja.currentDocument); 319 el = document.application.njUtils.make(name, null, this.application.ninja.currentDocument);
328 document.application.njUtils.createModelForComponent(el, "Button");
329 el.setAttribute("type", "button"); 320 el.setAttribute("type", "button");
330 el.innerHTML = "Button"; 321 el.innerHTML = "Button";
331 break; 322 break;
332 case "checkbox": 323 case "checkbox":
333 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); 324 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
334 document.application.njUtils.createModelForComponent(el, "Checkbox");
335 el.setAttribute("type", "checkbox"); 325 el.setAttribute("type", "checkbox");
336 break; 326 break;
337 case "imageComponent": 327 case "imageComponent":
338 el = document.application.njUtils.make("image", null, this.application.ninja.currentDocument); 328 el = document.application.njUtils.make("image", null, this.application.ninja.currentDocument);
339 document.application.njUtils.createModelForComponent(el, "Image");
340 el.setAttribute("width", 200); 329 el.setAttribute("width", 200);
341 el.setAttribute("height", 200); 330 el.setAttribute("height", 200);
342 break; 331 break;
343 case "numberInput": 332 case "numberInput":
344 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); 333 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
345 document.application.njUtils.createModelForComponent(el, "Number Input");
346 el.setAttribute("type", "number"); 334 el.setAttribute("type", "number");
347 break; 335 break;
348 case "select": 336 case "select":
349 el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); 337 el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument);
350 document.application.njUtils.createModelForComponent(el, "SelectInput");
351 break; 338 break;
352 case "radioButton": 339 case "radioButton":
353 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); 340 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
354 document.application.njUtils.createModelForComponent(el, "Radio Button");
355 el.setAttribute("type", "radio"); 341 el.setAttribute("type", "radio");
356 break; 342 break;
357 case "rangeInput": 343 case "rangeInput":
358 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); 344 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
359 document.application.njUtils.createModelForComponent(el, "Range Input");
360 el.setAttribute("type", "range"); 345 el.setAttribute("type", "range");
361 break; 346 break;
362 case "textfield": 347 case "textfield":
363 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); 348 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
364 document.application.njUtils.createModelForComponent(el, "Textfield");
365 el.setAttribute("type", "text"); 349 el.setAttribute("type", "text");
366 break; 350 break;
367 case "textarea": 351 case "textarea":
368 el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); 352 el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument);
369 document.application.njUtils.createModelForComponent(el, "Textarea");
370 break; 353 break;
371 case "toggleButton": 354 case "toggleButton":
372 el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); 355 el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument);
373 document.application.njUtils.createModelForComponent(el, "Toggle Button");
374 el.innerHTML = "Off"; 356 el.innerHTML = "Off";
375 break; 357 break;
376 case "map": 358 case "map":
377 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); 359 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument);
378 document.application.njUtils.createModelForComponent(el, "Map");
379 break; 360 break;
380 case "feedreader": 361 case "feedreader":
381 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); 362 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument);
382 document.application.njUtils.createModelForComponent(el, "Feed Reader");
383 break; 363 break;
384 case "picasa-carousel": 364 case "picasa-carousel":
385 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); 365 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument);
386 document.application.njUtils.createModelForComponent(el, "Picasa Carousel");
387 break; 366 break;
388 case "youtube-channel": 367 case "youtube-channel":
389 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); 368 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument);
390 document.application.njUtils.createModelForComponent(el, "Youtube Channel");
391 break; 369 break;
392 370
393 } 371 }