diff options
Diffstat (limited to 'js/panels')
15 files changed, 147 insertions, 212 deletions
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.html b/js/panels/Materials/materials-popup.reel/materials-popup.html index d18599d6..bac722cd 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.html +++ b/js/panels/Materials/materials-popup.reel/materials-popup.html | |||
@@ -43,7 +43,7 @@ | |||
43 | "data": { | 43 | "data": { |
44 | "boundObject": {"@": "materialsProperties"}, | 44 | "boundObject": {"@": "materialsProperties"}, |
45 | "boundObjectPropertyPath": "objectAtCurrentIteration", | 45 | "boundObjectPropertyPath": "objectAtCurrentIteration", |
46 | "oneway": false | 46 | "oneway": true |
47 | } | 47 | } |
48 | }, | 48 | }, |
49 | "listeners": [ | 49 | "listeners": [ |
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js index bd10f7a5..a4f758cf 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.js +++ b/js/panels/Materials/materials-popup.reel/materials-popup.js | |||
@@ -625,6 +625,11 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
625 | } | 625 | } |
626 | ] | 626 | ] |
627 | }, | 627 | }, |
628 | |||
629 | materialsProperties: { | ||
630 | serializable: true, | ||
631 | value: null | ||
632 | }, | ||
628 | 633 | ||
629 | _materialsData: { | 634 | _materialsData: { |
630 | enumerable: true, | 635 | enumerable: true, |
@@ -641,7 +646,7 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
641 | }, | 646 | }, |
642 | set: function(data) { | 647 | set: function(data) { |
643 | this._materialsData = data; | 648 | this._materialsData = data; |
644 | if(this.materialsProperties) | 649 | if(this.materialsProperties && data.length) |
645 | { | 650 | { |
646 | this.materialsProperties.needsDraw = true; | 651 | this.materialsProperties.needsDraw = true; |
647 | } | 652 | } |
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index b23da749..6358a0e0 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -721,7 +721,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
721 | this.dynamicLayerName.value = this._layerEditable.value; | 721 | this.dynamicLayerName.value = this._layerEditable.value; |
722 | this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value; | 722 | this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value; |
723 | this.needsDraw = true; | 723 | this.needsDraw = true; |
724 | this.application.ninja.documentController.activeDocument.needsSave = true; | 724 | this.application.ninja.documentController.activeDocument.model.needsSave = true; |
725 | } | 725 | } |
726 | }, | 726 | }, |
727 | handleAddStyleClick: { | 727 | handleAddStyleClick: { |
@@ -749,7 +749,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
749 | this.dynamicLayerName.value = newVal; | 749 | this.dynamicLayerName.value = newVal; |
750 | this.layerName = newVal; | 750 | this.layerName = newVal; |
751 | this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal; | 751 | this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal; |
752 | this.application.ninja.documentController.activeDocument.needsSave = true; | 752 | this.application.ninja.documentController.activeDocument.model.needsSave = true; |
753 | this.needsDraw = true; | 753 | this.needsDraw = true; |
754 | } | 754 | } |
755 | }, | 755 | }, |
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index d1cab096..c382c9a7 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -110,7 +110,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
110 | this._selectedLayerID = newVal; | 110 | this._selectedLayerID = newVal; |
111 | this._captureSelection = true; | 111 | this._captureSelection = true; |
112 | if (this.currentLayerSelected !== false) { | 112 | if (this.currentLayerSelected !== false) { |
113 | this.selectLayer(selectIndex, true); | 113 | this.selectLayer(selectIndex, false); |
114 | } | 114 | } |
115 | if (this.currentLayersSelected !== false) { | 115 | if (this.currentLayersSelected !== false) { |
116 | this.selectLayers(this.currentLayersSelected); | 116 | this.selectLayers(this.currentLayersSelected); |
@@ -994,7 +994,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
994 | this.arrLayers.splice(myIndex, 0, thingToPush); | 994 | this.arrLayers.splice(myIndex, 0, thingToPush); |
995 | 995 | ||
996 | } | 996 | } |
997 | this.selectLayer(myIndex); | 997 | this.selectLayer(myIndex, false); |
998 | } | 998 | } |
999 | }, | 999 | }, |
1000 | 1000 | ||
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index efeeba00..2c15a99c 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | |||
@@ -568,7 +568,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
568 | this.nextKeyframe += 1; | 568 | this.nextKeyframe += 1; |
569 | } | 569 | } |
570 | 570 | ||
571 | this.application.ninja.documentController.activeDocument.needsSave = true; | 571 | this.application.ninja.documentController.activeDocument.model.needsSave = true; |
572 | } | 572 | } |
573 | }, | 573 | }, |
574 | 574 | ||
@@ -687,7 +687,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
687 | keyframeString += " }"; | 687 | keyframeString += " }"; |
688 | // set the keyframe string as the new rule | 688 | // set the keyframe string as the new rule |
689 | this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString); | 689 | this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString); |
690 | this.application.ninja.documentController.activeDocument.needsSave = true; | 690 | this.application.ninja.documentController.activeDocument.model.needsSave = true; |
691 | } | 691 | } |
692 | }, | 692 | }, |
693 | 693 | ||
diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 4169423b..e028d1db 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js | |||
@@ -7,8 +7,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
7 | var Montage = require("montage/core/core").Montage, | 7 | var Montage = require("montage/core/core").Montage, |
8 | Component = require("montage/ui/component").Component, | 8 | Component = require("montage/ui/component").Component, |
9 | NJUtils = require("js/lib/NJUtils").NJUtils; | 9 | NJUtils = require("js/lib/NJUtils").NJUtils; |
10 | 10 | ClassUUID = require("js/components/core/class-uuid").ClassUuid, | |
11 | var PIData = require("js/data/pi/pi-data").PiData; | 11 | PIData = require("js/data/pi/pi-data").PiData; |
12 | 12 | ||
13 | String.prototype.capitalizeFirstChar = function() { | 13 | String.prototype.capitalizeFirstChar = function() { |
14 | return this.charAt(0).toUpperCase() + this.slice(1); | 14 | return this.charAt(0).toUpperCase() + this.slice(1); |
@@ -278,7 +278,7 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
278 | that = this; | 278 | that = this; |
279 | element = this.makeComponent(component.component); | 279 | element = this.makeComponent(component.component); |
280 | 280 | ||
281 | this.application.ninja.currentDocument._window.addComponent(element, {name: component.name, path: component.module}, function(instance, element) { | 281 | this.application.ninja.currentDocument.model.views.design.iframe.contentWindow.addComponent(element, {name: component.name, path: component.module}, function(instance, element) { |
282 | 282 | ||
283 | //var pos = that.getStageCenter(); | 283 | //var pos = that.getStageCenter(); |
284 | 284 | ||
@@ -295,21 +295,13 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
295 | } | 295 | } |
296 | } | 296 | } |
297 | 297 | ||
298 | instance.addEventListener('firstDraw', that, false); | 298 | that.application.ninja.currentDocument.model.setComponentInstance(instance, element); |
299 | |||
300 | that.application.ninja.currentDocument.setComponentInstance(instance, element); | ||
301 | 299 | ||
302 | that.application.ninja.elementMediator.addElements(element, styles); | 300 | that.application.ninja.elementMediator.addElements(element, styles); |
303 | }); | 301 | }); |
304 | 302 | ||
305 | } | 303 | } |
306 | }, | 304 | }, |
307 | |||
308 | handleFirstDraw: { | ||
309 | value: function (e) { | ||
310 | NJevent("addComponentFirstDraw"); | ||
311 | } | ||
312 | }, | ||
313 | 305 | ||
314 | makeComponent: { | 306 | makeComponent: { |
315 | value: function(name) { | 307 | value: function(name) { |
@@ -346,7 +338,7 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
346 | break; | 338 | break; |
347 | case "select": | 339 | case "select": |
348 | el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); | 340 | el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); |
349 | document.application.njUtils.createModelForComponent(el, "Select"); | 341 | document.application.njUtils.createModelForComponent(el, "SelectInput"); |
350 | break; | 342 | break; |
351 | case "radioButton": | 343 | case "radioButton": |
352 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |