aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorhwc4872012-06-12 15:52:35 -0700
committerhwc4872012-06-12 15:52:35 -0700
commit9490f816924e9e9c9970ef9384241c07ec0a6e9f (patch)
treef44449a2e0055e21960a5513fb3a0738a91db528 /js/panels
parentb7a41cbd5a30d32f524ee60e2dfdf9c65c7ec55b (diff)
parent6854a72504f57903bd5de003e377f2aefb02d0da (diff)
downloadninja-9490f816924e9e9c9970ef9384241c07ec0a6e9f.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts: assets/canvas-runtime.js js/io/system/ninjalibrary.json js/mediators/element-mediator.js
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js28
-rwxr-xr-xjs/panels/components-panel.reel/components-panel.js22
-rwxr-xr-xjs/panels/properties.reel/properties.js4
-rwxr-xr-xjs/panels/properties.reel/sections/custom.reel/custom.js2
-rw-r--r--js/panels/resize-composer.js5
5 files changed, 23 insertions, 38 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index d7329ac7..f7ab5117 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -53,6 +53,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
53 } 53 }
54 } 54 }
55 }, 55 },
56
57 handleChange: {
58 value: function() {
59 if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) {
60 this.currentSelectedContainer = this.currentDocument.model.getProperty("domContainer");
61 }
62 }
63 },
56 64
57 _currentSelectedContainer: { 65 _currentSelectedContainer: {
58 value: null 66 value: null
@@ -405,13 +413,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
405 this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false); 413 this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false);
406 document.addEventListener("click", this.handleDocumentClick.bind(this), false); 414 document.addEventListener("click", this.handleDocumentClick.bind(this), false);
407 415
408 416 this.addPropertyChangeListener("currentDocument.model.domContainer", this);
409 // Bind some bindings
410 Object.defineBinding(this, "currentSelectedContainer", {
411 boundObject:this.application.ninja,
412 boundObjectPropertyPath:"currentSelectedContainer",
413 oneway:true
414 });
415 417
416 } 418 }
417 }, 419 },
@@ -512,7 +514,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
512 if (this._boolCacheArrays) { 514 if (this._boolCacheArrays) {
513 // ... but only if we're supposed to. 515 // ... but only if we're supposed to.
514 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; 516 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
515 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; 517 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer;
516 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; 518 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
517 this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; 519 this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected;
518 this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected; 520 this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected;
@@ -525,7 +527,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
525 // Initialize the currentDocument for a new set of timeline data. 527 // Initialize the currentDocument for a new set of timeline data.
526 this.application.ninja.currentDocument.isTimelineInitialized = true; 528 this.application.ninja.currentDocument.isTimelineInitialized = true;
527 this.application.ninja.currentDocument.tlArrLayers = []; 529 this.application.ninja.currentDocument.tlArrLayers = [];
528 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; 530 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer;
529 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; 531 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
530 this.application.ninja.currentDocument.tlCurrentLayerSelected = false; 532 this.application.ninja.currentDocument.tlCurrentLayerSelected = false;
531 this.application.ninja.currentDocument.tlCurrentLayersSelected = false; 533 this.application.ninja.currentDocument.tlCurrentLayersSelected = false;
@@ -669,7 +671,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
669 // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick'); 671 // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick');
670 // Information stored, but we're moving up or down in the breadcrumb. 672 // Information stored, but we're moving up or down in the breadcrumb.
671 // Get the current selection and restore timeline info for its children. 673 // Get the current selection and restore timeline info for its children.
672 var parentNode = this.application.ninja.currentSelectedContainer, 674 var parentNode = this.currentDocument.model.domContainer,
673 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 675 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
674 this.temparrLayers = []; 676 this.temparrLayers = [];
675 677
@@ -708,7 +710,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
708 710
709 //debugger; 711 //debugger;
710 if (typeof(this.application.ninja.currentDocument.tlCurrentSelectedContainer) !== "undefined") { 712 if (typeof(this.application.ninja.currentDocument.tlCurrentSelectedContainer) !== "undefined") {
711// this.application.ninja.currentSelectedContainer=this.application.ninja.currentDocument.tlCurrentSelectedContainer; 713// this.currentDocument.model.domContainer = this.application.ninja.currentDocument.tlCurrentSelectedContainer;
712 } 714 }
713 715
714 // Are we only showing animated layers? 716 // Are we only showing animated layers?
@@ -984,7 +986,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
984 thingToPush.layerData.layerName = newLayerName; 986 thingToPush.layerData.layerName = newLayerName;
985 thingToPush.layerData.layerTag = "<" + object.nodeName.toLowerCase() + ">"; 987 thingToPush.layerData.layerTag = "<" + object.nodeName.toLowerCase() + ">";
986 thingToPush.layerData.layerID = this.currentLayerNumber; 988 thingToPush.layerData.layerID = this.currentLayerNumber;
987 thingToPush.parentElement = this.application.ninja.currentSelectedContainer; 989 thingToPush.parentElement = this.currentDocument.model.domContainer;
988 thingToPush.layerData.isSelected = true; 990 thingToPush.layerData.isSelected = true;
989 thingToPush.layerData._isFirstDraw = true; 991 thingToPush.layerData._isFirstDraw = true;
990 thingToPush.layerData.created = true; 992 thingToPush.layerData.created = true;
@@ -1032,7 +1034,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1032 thingToPush.layerData.layerName = newLayerName; 1034 thingToPush.layerData.layerName = newLayerName;
1033 thingToPush.layerData.layerID = this.currentLayerNumber; 1035 thingToPush.layerData.layerID = this.currentLayerNumber;
1034 thingToPush.layerData.layerTag = "<" + ele.nodeName.toLowerCase() + ">"; 1036 thingToPush.layerData.layerTag = "<" + ele.nodeName.toLowerCase() + ">";
1035 thingToPush.parentElement = this.application.ninja.currentSelectedContainer; 1037 thingToPush.parentElement = this.currentDocument.model.domContainer;
1036 if (this.checkable_animated.classList.contains("checked")) { 1038 if (this.checkable_animated.classList.contains("checked")) {
1037 thingToPush.layerData.isVisible = false; 1039 thingToPush.layerData.isVisible = false;
1038 } 1040 }
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":