aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js52
-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, 34 insertions, 51 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 22991a82..658ac043 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -141,6 +141,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
141 } 141 }
142 } 142 }
143 }, 143 },
144
145 handleChange: {
146 value: function() {
147 if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) {
148 this.currentSelectedContainer = this.currentDocument.model.getProperty("domContainer");
149 }
150 }
151 },
144 152
145 _currentSelectedContainer: { 153 _currentSelectedContainer: {
146 value: null 154 value: null
@@ -213,7 +221,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
213 }, 221 },
214 set:function (newVal) { 222 set:function (newVal) {
215 this._layerRepetition = newVal; 223 this._layerRepetition = newVal;
216 }, 224 },
217 serializable: true 225 serializable: true
218 }, 226 },
219 227
@@ -338,7 +346,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
338 }, 346 },
339 set:function (newVal) { 347 set:function (newVal) {
340 this._trackRepetition = newVal; 348 this._trackRepetition = newVal;
341 }, 349 },
342 serializable: true 350 serializable: true
343 }, 351 },
344 352
@@ -495,13 +503,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
495 this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false); 503 this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false);
496 document.addEventListener("click", this.handleDocumentClick.bind(this), false); 504 document.addEventListener("click", this.handleDocumentClick.bind(this), false);
497 505
498 506 this.addPropertyChangeListener("currentDocument.model.domContainer", this);
499 // Bind some bindings
500 Object.defineBinding(this, "currentSelectedContainer", {
501 boundObject:this.application.ninja,
502 boundObjectPropertyPath:"currentSelectedContainer",
503 oneway:true
504 });
505 507
506 } 508 }
507 }, 509 },
@@ -601,13 +603,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
601 // Store the timeline data in currentDocument... 603 // Store the timeline data in currentDocument...
602 if (this._boolCacheArrays) { 604 if (this._boolCacheArrays) {
603 // ... but only if we're supposed to. 605 // ... but only if we're supposed to.
604 if(this.currentDocument) { 606 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
605 this.currentDocument.tlArrLayers = this.arrLayers; 607 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer;
606 this.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; 608 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
607 this.currentDocument.tllayerNumber = this.currentLayerNumber; 609 this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected;
608 this.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; 610 this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected;
609 this.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected;
610 }
611 } 611 }
612 } 612 }
613 }, 613 },
@@ -615,12 +615,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
615 initTimelineCache: { 615 initTimelineCache: {
616 value: function() { 616 value: function() {
617 // Initialize the currentDocument for a new set of timeline data. 617 // Initialize the currentDocument for a new set of timeline data.
618 this.currentDocument.isTimelineInitialized = true; 618 this.application.ninja.currentDocument.isTimelineInitialized = true;
619 this.currentDocument.tlArrLayers = []; 619 this.application.ninja.currentDocument.tlArrLayers = [];
620 this.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; 620 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer;
621 this.currentDocument.tllayerNumber = this.currentLayerNumber; 621 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
622 this.currentDocument.tlCurrentLayerSelected = false; 622 this.application.ninja.currentDocument.tlCurrentLayerSelected = false;
623 this.currentDocument.tlCurrentLayersSelected = false; 623 this.application.ninja.currentDocument.tlCurrentLayersSelected = false;
624 } 624 }
625 }, 625 },
626 626
@@ -761,7 +761,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
761 // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick'); 761 // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick');
762 // Information stored, but we're moving up or down in the breadcrumb. 762 // Information stored, but we're moving up or down in the breadcrumb.
763 // Get the current selection and restore timeline info for its children. 763 // Get the current selection and restore timeline info for its children.
764 var parentNode = this.application.ninja.currentSelectedContainer, 764 var parentNode = this.currentDocument.model.domContainer,
765 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 765 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
766 this.temparrLayers = []; 766 this.temparrLayers = [];
767 767
@@ -800,7 +800,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
800 800
801 //debugger; 801 //debugger;
802 if (typeof(this.application.ninja.currentDocument.tlCurrentSelectedContainer) !== "undefined") { 802 if (typeof(this.application.ninja.currentDocument.tlCurrentSelectedContainer) !== "undefined") {
803// this.application.ninja.currentSelectedContainer=this.application.ninja.currentDocument.tlCurrentSelectedContainer; 803// this.currentDocument.model.domContainer = this.application.ninja.currentDocument.tlCurrentSelectedContainer;
804 } 804 }
805 805
806 // Are we only showing animated layers? 806 // Are we only showing animated layers?
@@ -1076,7 +1076,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1076 thingToPush.layerData.layerName = newLayerName; 1076 thingToPush.layerData.layerName = newLayerName;
1077 thingToPush.layerData.layerTag = "<" + object.nodeName.toLowerCase() + ">"; 1077 thingToPush.layerData.layerTag = "<" + object.nodeName.toLowerCase() + ">";
1078 thingToPush.layerData.layerID = this.currentLayerNumber; 1078 thingToPush.layerData.layerID = this.currentLayerNumber;
1079 thingToPush.parentElement = this.application.ninja.currentSelectedContainer; 1079 thingToPush.parentElement = this.currentDocument.model.domContainer;
1080 thingToPush.layerData.isSelected = true; 1080 thingToPush.layerData.isSelected = true;
1081 thingToPush.layerData._isFirstDraw = true; 1081 thingToPush.layerData._isFirstDraw = true;
1082 thingToPush.layerData.created = true; 1082 thingToPush.layerData.created = true;
@@ -1124,7 +1124,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1124 thingToPush.layerData.layerName = newLayerName; 1124 thingToPush.layerData.layerName = newLayerName;
1125 thingToPush.layerData.layerID = this.currentLayerNumber; 1125 thingToPush.layerData.layerID = this.currentLayerNumber;
1126 thingToPush.layerData.layerTag = "<" + ele.nodeName.toLowerCase() + ">"; 1126 thingToPush.layerData.layerTag = "<" + ele.nodeName.toLowerCase() + ">";
1127 thingToPush.parentElement = this.application.ninja.currentSelectedContainer; 1127 thingToPush.parentElement = this.currentDocument.model.domContainer;
1128 if (this.checkable_animated.classList.contains("checked")) { 1128 if (this.checkable_animated.classList.contains("checked")) {
1129 thingToPush.layerData.isVisible = false; 1129 thingToPush.layerData.isVisible = false;
1130 } 1130 }
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