diff options
Diffstat (limited to 'js/panels')
11 files changed, 92 insertions, 187 deletions
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); | 344 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
@@ -366,7 +358,7 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
366 | break; | 358 | break; |
367 | case "textarea": | 359 | case "textarea": |
368 | el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); | 360 | el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); |
369 | document.application.njUtils.createModelForComponent(el, "TextArea"); | 361 | document.application.njUtils.createModelForComponent(el, "Textarea"); |
370 | break; | 362 | break; |
371 | case "toggleButton": | 363 | case "toggleButton": |
372 | el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); | 364 | el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); |
@@ -392,6 +384,8 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
392 | 384 | ||
393 | } | 385 | } |
394 | 386 | ||
387 | el.setAttribute("data-montage-id", ClassUUID.generate()); | ||
388 | |||
395 | return el; | 389 | return el; |
396 | } | 390 | } |
397 | }, | 391 | }, |
@@ -404,8 +398,8 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
404 | //if(!this.centerStage) { | 398 | //if(!this.centerStage) { |
405 | var top, left; | 399 | var top, left; |
406 | 400 | ||
407 | top = ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); | 401 | top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); |
408 | left = ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); | 402 | left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); |
409 | //this.centerStage = [top, left]; | 403 | //this.centerStage = [top, left]; |
410 | return [left, top]; | 404 | return [left, top]; |
411 | //} | 405 | //} |
diff --git a/js/panels/properties.reel/properties.css b/js/panels/properties.reel/properties.css index eee44561..5306eb5b 100755 --- a/js/panels/properties.reel/properties.css +++ b/js/panels/properties.reel/properties.css | |||
@@ -271,17 +271,17 @@ padding-right:6px; | |||
271 | content: "•"; | 271 | content: "•"; |
272 | } | 272 | } |
273 | 273 | ||
274 | .propertiesPanel input.nj-skinned label { | 274 | .propertiesPanel .checkbox-label { |
275 | position: absolute; | 275 | position: absolute; |
276 | top: 0; | 276 | top: 4px; |