From a341522e3603c18ab3b93defa894e3be702dd0f4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 22 May 2012 17:45:35 -0700 Subject: fixing the undefined 'color' issue Signed-off-by: Valerio Virgillito --- js/panels/properties.reel/properties.js | 32 ++++++++++++++-------- .../properties.reel/sections/custom.reel/custom.js | 2 +- 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'js/panels') diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index eb362796..b292a66a 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -48,6 +48,7 @@ exports.Properties = Montage.create(Component, { value : function() { this.eventManager.addEventListener("openDocument", this, false); this.eventManager.addEventListener("selectionChange", this, false); + this.eventManager.addEventListener("closeDocument", this, false); // This will be a toggle option if(this.application.ninja.appData.PILiveUpdate) { @@ -76,6 +77,12 @@ exports.Properties = Montage.create(Component, { } }, + handleCloseDocument: { + value: function(){ + this.clear(); + } + }, + /** * Blur and Key up to handle change in the Element ID field. */ @@ -172,6 +179,7 @@ exports.Properties = Montage.create(Component, { this.elementId.value = ""; this.elementClass.value = ""; this.customPi = null; + this.customSections = []; } }, @@ -211,27 +219,29 @@ exports.Properties = Montage.create(Component, { controls = this.customSections[n].content.controls; if(controls["colorSelect"]) { controls["colorSelect"].destroy(); - } else if(controls["stageBackground"]) { - controls["stageBackground"].destroy(); + } else if(controls["background"]) { + controls["background"].destroy(); } } this.customPi = el.elementModel.pi; this.displayCustomProperties(el, el.elementModel.pi); - } - // Root element color chip - if(isRoot) { - var backgroundChip = this.customSections[0].content.controls["background"]; - var rootBackgroundColor = ElementsMediator.getProperty(el, "background"); + // Root element color chip + if(isRoot) { + var backgroundChip = this.customSections[0].content.controls["background"]; + var rootBackgroundColor = ElementsMediator.getProperty(el, "background"); - if(rootBackgroundColor) { - backgroundChip.color = rootBackgroundColor; - } else { - backgroundChip.color = null; + if(rootBackgroundColor) { + backgroundChip.color = rootBackgroundColor; + } else { + backgroundChip.color = null; + } } } + + var previousInput = this.application.ninja.colorController.colorModel.input; customPI = PiData[this.customPi]; // Get all the custom section for the custom PI diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js index 49b4414e..b1fd910d 100755 --- a/js/panels/properties.reel/sections/custom.reel/custom.js +++ b/js/panels/properties.reel/sections/custom.reel/custom.js @@ -400,7 +400,7 @@ exports.CustomSection = Montage.create(Component, { this.controls[aField.id] = obj; // TODO - Hack for now to reference the color select object to unregister color chips - this.controls["stageBackground"] = obj; + this.controls["background"] = obj; return obj; } -- cgit v1.2.3 From ee54342b5f4fdd41c46543d6402e649e4b3d57cb Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 22 May 2012 17:58:23 -0700 Subject: - don't redraw stage for code document - fixes a switching bug - fix for ctrl+S for code document - disallow opening the panels while in code document Signed-off-by: Ananya Sen --- js/panels/Splitter.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js index 0640abb2..8675d314 100755 --- a/js/panels/Splitter.js +++ b/js/panels/Splitter.js @@ -111,8 +111,9 @@ exports.Splitter = Montage.create(Component, { } else { this.panel.removeEventListener("webkitTransitionEnd", this, false); } - - this.application.ninja.stage.resizeCanvases = true; + if(this.application.ninja.currentDocument.currentView === "design"){ + this.application.ninja.stage.resizeCanvases = true; + } } }, @@ -149,6 +150,7 @@ exports.Splitter = Montage.create(Component, { this.panel.addEventListener("webkitTransitionEnd", this, false); } this._collapsed = true; + this.disabled = true; this.needsDraw = true; } } @@ -169,6 +171,7 @@ exports.Splitter = Montage.create(Component, { } else { this.panel.addEventListener("webkitTransitionEnd", this, false); } + this.disabled = false; this.needsDraw = true; } } -- cgit v1.2.3 From 56b03609ada81b270f870d1bb0727ef146cb62e8 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 22 May 2012 22:45:41 -0700 Subject: minor formatting fixes Signed-off-by: Valerio Virgillito --- js/panels/PanelContainer.reel/PanelContainer.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/panels') diff --git a/js/panels/PanelContainer.reel/PanelContainer.html b/js/panels/PanelContainer.reel/PanelContainer.html index 1de88de3..1c144bf4 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.html +++ b/js/panels/PanelContainer.reel/PanelContainer.html @@ -54,11 +54,12 @@ "element": {"#": "panel_5"} } }, + "panel_6": { "module": "js/panels/Panel.reel", "name": "Panel", "properties": { - "element": {"#": "panel_6"} + "element": {"#": "panel_6"} } }, -- cgit v1.2.3 From f1dbf7c58e91a27c80f3a607e87ad122d803c500 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 23 May 2012 13:29:13 -0700 Subject: Timeline triggerBinding needs to be set to false in the track data. Signed-off-by: Nivesh Rajbhandari --- js/panels/Timeline/Layer.reel/Layer.js | 6 +----- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 9 +++------ js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 6 +----- 3 files changed, 5 insertions(+), 16 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 6358a0e0..e8619d02 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -498,11 +498,7 @@ var Layer = exports.Layer = Montage.create(Component, { triggerOutgoingBinding : { value: function() { - if (this.layerData.triggerBinding === true) { - this.layerData.triggerBinding = false; - } else { - this.layerData.triggerBinding = true; - } + this.layerData.triggerBinding = !this.layerData.triggerBinding; } }, /* END: Models */ diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index c382c9a7..80133edf 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -437,6 +437,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { returnObj.layerData.isVisible = true; returnObj.layerData.docUUID = this.application.ninja.currentDocument._uuid; returnObj.layerData.isTrackAnimated = false; + returnObj.layerData.triggerBinding = false; returnObj.parentElementUUID = null; returnObj.parentElement = null; @@ -1402,12 +1403,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // Trigger the layer/track data binding triggerLayerBinding : { value: function(intIndex) { - if (this.arrLayers[intIndex].layerData.triggerBinding === true) { - this.arrLayers[intIndex].layerData.triggerBinding = false; - } else { - this.arrLayers[intIndex].layerData.triggerBinding = true; - } - } + this.arrLayers[intIndex].layerData.triggerBinding = !this.arrLayers[intIndex].layerData.triggerBinding; + } }, handleLayerDragStart : { diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 2c15a99c..3d83dc36 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -405,11 +405,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { triggerOutgoingBinding : { value: function() { - if (this.trackData.triggerBinding === true) { - this.trackData.triggerBinding = false; - } else { - this.trackData.triggerBinding = true; - } + this.trackData.triggerBinding = !this.trackData.triggerBinding; } }, -- cgit v1.2.3 From 26d4cbf0f5c65f60051273f1648a0e8005d8c78a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 23 May 2012 13:40:56 -0700 Subject: - removed redundant change - fixed js error on click of splitters when no documents are open Signed-off-by: Ananya Sen --- js/panels/Splitter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/panels') diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js index 8675d314..f0fb1a45 100755 --- a/js/panels/Splitter.js +++ b/js/panels/Splitter.js @@ -111,7 +111,7 @@ exports.Splitter = Montage.create(Component, { } else { this.panel.removeEventListener("webkitTransitionEnd", this, false); } - if(this.application.ninja.currentDocument.currentView === "design"){ + if(this.application.ninja.currentDocument && this.application.ninja.currentDocument.currentView === "design"){ this.application.ninja.stage.resizeCanvases = true; } } -- cgit v1.2.3 From 0ca1910df1c78116139664bf39a95cf0ec7c8dc8 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 23 May 2012 15:35:15 -0700 Subject: adding document views checks for the timeline and breadcrumb Signed-off-by: Valerio Virgillito --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 80133edf..2c02e544 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -596,7 +596,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // That's all we need to do for a brand new file. // But what if we're opening an existing document? - if (!this.application.ninja.documentController.creatingNewFile) { + if (!this.application.ninja.documentController.creatingNewFile && this.application.ninja.currentDocument.currentView !== "code") { // Opening an existing document. If it has DOM elements we need to restore their timeline info if (this.application.ninja.currentDocument.documentRoot.children[0]) { // Yes, it has DOM elements. Loop through them and create a new object for each. -- cgit v1.2.3 From 5914c5b2209c4b8daac4249bb76cda5c9314c4e6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 24 May 2012 00:07:23 -0700 Subject: Cleaning up referencing to 'documentRoot' and '_document' Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view. --- js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js | 2 +- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 6 +++--- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 4 ++-- js/panels/components-panel.reel/components-panel.js | 4 ++-- js/panels/css-panel/styles-view-delegate.js | 2 +- js/panels/properties.reel/properties.js | 12 ++++++------ js/panels/properties.reel/sections/custom.reel/custom.js | 2 +- .../sections/position-size.reel/position-size.js | 8 ++++---- .../sections/three-d-view.reel/three-d-view.js | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) (limited to 'js/panels') diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js index 4c0a3611..b4a803b2 100755 --- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js +++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js @@ -87,7 +87,7 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre populateStyleSheetList: { value: function() { - this.sections.sheets.doc = this.application.ninja.currentDocument._document; + this.sections.sheets.doc = this.application.ninja.currentDocument.model.views.design.document; var styleTagCount = 0, sect = this.sections.sheets, sheetsArray = nj.toArray(sect.doc.styleSheets), diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index c382c9a7..d61075ac 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -597,11 +597,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // But what if we're opening an existing document? if (!this.application.ninja.documentController.creatingNewFile) { // Opening an existing document. If it has DOM elements we need to restore their timeline info - if (this.application.ninja.currentDocument.documentRoot.children[0]) { + if (this.application.ninja.currentDocument.model.documentRoot.children[0]) { // Yes, it has DOM elements. Loop through them and create a new object for each. - for (myIndex = 0; this.application.ninja.currentDocument.documentRoot.children[myIndex]; myIndex++) { + for (myIndex = 0; this.application.ninja.currentDocument.model.documentRoot.children[myIndex]; myIndex++) { this._openDoc = true; - this.restoreLayer(this.application.ninja.currentDocument.documentRoot.children[myIndex]); + this.restoreLayer(this.application.ninja.currentDocument.model.documentRoot.children[myIndex]); } } } diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 2c15a99c..adc50c58 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -438,7 +438,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { didDraw:{ value:function () { if ((!this.application.ninja.documentController.creatingNewFile)||(!this.application.ninja.currentDocument.setLevel)) { - if (this.application.ninja.currentDocument.documentRoot.children[0]) { + if (this.application.ninja.currentDocument.model.documentRoot.children[0]) { var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); if (selectedIndex !== false) { if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) { @@ -592,7 +592,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); this.nextKeyframe = 0; - this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); + this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument.model.views.design.document); for (i =0; this.currentKeyframeRule[i] ;i++) { var newTween = {}; diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index e028d1db..3ad1763d 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -398,8 +398,8 @@ exports.ComponentsPanel = Montage.create(Component, { //if(!this.centerStage) { var top, left; - top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); - left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); + top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.model.documentRoot, "height"))) / 2); + left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.model.documentRoot, "width"))) / 2); //this.centerStage = [top, left]; return [left, top]; //} diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js index 5229b92e..454008fa 100644 --- a/js/panels/css-panel/styles-view-delegate.js +++ b/js/panels/css-panel/styles-view-delegate.js @@ -30,7 +30,7 @@ exports.StylesViewDelegate = Montage.create(Component, { value: function(selector, direction) { if(!selector) { return false; } - var elements = this.stylesController._activeDocument._document.querySelectorAll(selector), + var elements = this.stylesController._activeDocument.model.views.design.document.querySelectorAll(selector), method = (direction === "out") ? "remove" : "add"; Array.prototype.slice.call(elements).forEach(function(el) { diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index b292a66a..e3ecce10 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -73,7 +73,7 @@ exports.Properties = Montage.create(Component, { this.application.ninja.currentDocument.model.views.design.propertiesPanel = this; // Display the default document root PI - this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); + this.displayElementProperties(this.application.ninja.currentDocument.model.documentRoot); } }, @@ -95,7 +95,7 @@ exports.Properties = Montage.create(Component, { this.elementId.value = this.elementId.value.replace(/\s/g, ''); // Check if that id is in use - if(this.application.ninja.currentDocument._document.getElementById(this.elementId.value) !== null) { + if(this.application.ninja.currentDocument.model.views.design.document.getElementById(this.elementId.value) !== null) { // TODO: Replace with Ninja Alert alert("The following ID: " + this.elementId.value + " is already in use"); } @@ -104,13 +104,13 @@ exports.Properties = Montage.create(Component, { // ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi"); ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, this.application.ninja.selectedElements[0].id, "pi"); } else { - ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.id); + ElementsMediator.setAttribute(this.application.ninja.currentDocument.model.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.model.documentRoot.elementModel.id); } } else if(event.target.id === "elementClass") { if(this.application.ninja.selectedElements.length) { ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, this.application.ninja.selectedElements[0].className, "pi"); } else { - ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.elementClass); + ElementsMediator.setAttribute(this.application.ninja.currentDocument.model.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.model.documentRoot.elementModel.elementClass); } } } @@ -135,7 +135,7 @@ exports.Properties = Montage.create(Component, { value: function(event) { // console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update if(event.detail.source && event.detail.source !== "pi") { - var el = this.application.ninja.currentDocument.documentRoot; + var el = this.application.ninja.currentDocument.model.documentRoot; if(this.application.ninja.selectedElements.length) { el = this.application.ninja.selectedElements[0]; } @@ -161,7 +161,7 @@ exports.Properties = Montage.create(Component, { handleSelectionChange: { value: function(event) { if(event.detail.isDocument) { - this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); + this.displayElementProperties(this.application.ninja.currentDocument.model.documentRoot); } else { if(this.application.ninja.selectedElements.length === 1) { this.displayElementProperties(this.application.ninja.selectedElements[0]); diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js index b1fd910d..ae408f11 100755 --- a/js/panels/properties.reel/sections/custom.reel/custom.js +++ b/js/panels/properties.reel/sections/custom.reel/custom.js @@ -116,7 +116,7 @@ exports.CustomSection = Montage.create(Component, { value: function(event) { // Change the stage color for now //console.log(this, event); - ElementsMediator.setProperty([this.application.ninja.currentDocument.documentRoot], this.id, [event._event.color.css], "Change", "pi", ''); + ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], this.id, [event._event.color.css], "Change", "pi", ''); /* var propEvent = document.createEvent("CustomEvent"); propEvent.initEvent("propertyChange", true, true); diff --git a/js/panels/properties.reel/sections/position-size.reel/position-size.js b/js/panels/properties.reel/sections/position-size.reel/position-size.js index 10e084be..7c24e02a 100755 --- a/js/panels/properties.reel/sections/position-size.reel/position-size.js +++ b/js/panels/properties.reel/sections/position-size.reel/position-size.js @@ -158,7 +158,7 @@ exports.PositionSize = Montage.create(Component, { if(!event.wasSetByCode) { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; - this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; + this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot]; if(this.bindButton.pressed) { @@ -183,7 +183,7 @@ exports.PositionSize = Montage.create(Component, { if(!event.wasSetByCode) { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; - this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; + this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot]; if(this.bindButton.pressed) { @@ -231,7 +231,7 @@ exports.PositionSize = Montage.create(Component, { if(!this.savedPosition) this.savedPosition = this.heightSize; - this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; + this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot]; if(this.bindButton.pressed) { @@ -256,7 +256,7 @@ exports.PositionSize = Montage.create(Component, { if(!this.savedPosition) this.savedPosition = this.widthSize; - this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; + this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot]; if(this.bindButton.pressed) { var newHeight = Math.round(this.aspectRatioWidth * this.widthControl.value); diff --git a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js index dcba51a4..e16e3509 100755 --- a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js +++ b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js @@ -247,7 +247,7 @@ exports.ThreeD = Montage.create(Component, { if(els.length) { return els[0]; } else { - return this.boundObject.application.ninja.currentDocument.documentRoot; + return this.boundObject.application.ninja.currentDocument.model.documentRoot; } } }, -- cgit v1.2.3 From 83fff4ad660e4c9ea82c234f051c58d96f84f3e3 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 25 May 2012 15:18:41 -0700 Subject: fix for the id and class controls in the pi the id and class did not set values from the pi because of the removals of all id's on element. Signed-off-by: Valerio Virgillito --- js/panels/properties.reel/properties.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/panels') diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index e3ecce10..84b0d589 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -89,7 +89,7 @@ exports.Properties = Montage.create(Component, { handleBlur: { value: function(event) { - if(event.target.id === "elementId") { + if(event.target === this.elementId.element) { // Remove all white spaces from the id this.elementId.value = this.elementId.value.replace(/\s/g, ''); @@ -106,7 +106,7 @@ exports.Properties = Montage.create(Component, { } else { ElementsMediator.setAttribute(this.application.ninja.currentDocument.model.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.model.documentRoot.elementModel.id); } - } else if(event.target.id === "elementClass") { + } else if(event.target === this.elementClass.element) { if(this.application.ninja.selectedElements.length) { ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, this.application.ninja.selectedElements[0].className, "pi"); } else { -- cgit v1.2.3