From 7a94696e19b14e15261df516e2ba75e693b1313d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 00:21:56 -0700 Subject: enabling basic document switching Signed-off-by: Valerio Virgillito --- js/panels/properties.reel/properties.js | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'js/panels') diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index fa62c850..4d048472 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -55,7 +55,6 @@ exports.Properties = Montage.create(Component, { } this.eventManager.addEventListener("openDocument", this, false); - this.eventManager.addEventListener("switchDocument", this, false); this.elementId.element.addEventListener("blur", this, false); this.elementId.element.addEventListener("focus", this, false); @@ -76,21 +75,6 @@ exports.Properties = Montage.create(Component, { } }, - handleSwitchDocument: { - value: function(){ - // For now always assume that the stage is selected by default - if(this.application.ninja.selectedElements.length === 0) { - this.displayStageProperties(); - } else { - if(this.application.ninja.selectedElements.length === 1) { - this.displayElementProperties(this.application.ninja.selectedElements[0]); - } else { - this.displayGroupProperties(this.application.ninja.selectedElements); - } - } - } - }, - /** * Blur and Key up to handle change in the Element ID field. */ -- cgit v1.2.3 From 3e22b0940bb7752e292e485d8a393f215cae05de Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 18 May 2012 15:14:36 -0700 Subject: Fixed Materials Popup to work with new changes to repetition bindings. Signed-off-by: Nivesh Rajbhandari --- js/panels/Materials/materials-popup.reel/materials-popup.html | 2 +- js/panels/Materials/materials-popup.reel/materials-popup.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'js/panels') 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 @@ "data": { "boundObject": {"@": "materialsProperties"}, "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": false + "oneway": true } }, "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, { } ] }, + + materialsProperties: { + serializable: true, + value: null + }, _materialsData: { enumerable: true, @@ -641,7 +646,7 @@ exports.MaterialsPopup = Montage.create(Component, { }, set: function(data) { this._materialsData = data; - if(this.materialsProperties) + if(this.materialsProperties && data.length) { this.materialsProperties.needsDraw = true; } -- cgit v1.2.3 From f30e5613e37ec6858fe4b56d289fafb9f1b9b9f8 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 18 May 2012 16:12:30 -0700 Subject: Fixing button controls in the Properties Panel for changes in montage v.10 drawing. Signed-off-by: Nivesh Rajbhandari --- js/panels/properties.reel/properties.css | 30 ++++++++++++++++++++++ .../custom-rows/dual-row.reel/dual-row.html | 10 ++------ .../sections/custom-rows/dual-row.reel/dual-row.js | 3 +-- 3 files changed, 33 insertions(+), 10 deletions(-) (limited to 'js/panels') diff --git a/js/panels/properties.reel/properties.css b/js/panels/properties.reel/properties.css index 5306eb5b..3166a1ff 100755 --- a/js/panels/properties.reel/properties.css +++ b/js/panels/properties.reel/properties.css @@ -303,4 +303,34 @@ input label { .propertiesPanel .rotation .fieldRow { -webkit-box-flex:0; width:45px; +} + +.propertiesPanel div.montage-button:disabled { + opacity: 0.4; +} + +.propertiesPanel div.montage-button { + font-size: 9px; + cursor: pointer; + display: block; + margin: -3px 0 0 -12px; + padding: 4px; + border: 1px #313131 solid; + background-color: #474747; + background-image: -webkit-linear-gradient(top, #505050 0%, #3c3c3c 100%); + border-radius: 4px; + color: white; + text-transform: uppercase; + cursor: pointer; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5); + width: 18px; + height: 14px; +} + +.propertiesPanel div.montage-button:active { + background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #505050 100%); +} + +.propertiesPanel div.montage-button:hover { + -webkit-box-shadow: 0px 0px 3px #b4b4b4; } \ No newline at end of file diff --git a/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.html b/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.html index bdcbff7f..c3af0668 100755 --- a/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.html +++ b/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.html @@ -22,10 +22,7 @@ "element": { "#": "slotElement" } }, "bindings": { - "content" : { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "content" - } + "content": {"<-": "@owner.content"} } }, "slot2": { @@ -34,10 +31,7 @@ "element": { "#": "slotElement2" } }, "bindings": { - "content" : { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "content2" - } + "content": {"<-": "@owner.content2"} } } } diff --git a/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js b/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js index 4c5c80d7..2f81aa2e 100755 --- a/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js +++ b/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js @@ -44,8 +44,7 @@ exports.DualRow = Montage.create(Component, { } if(this.label2 !== null) { if(this.content2.type === "button") { - this.content2.element = document.createElement("button"); - this.content2.element.classList.add("nj-skinned"); + this.content2.label = this.label2; this.element.getElementsByClassName("lbl")[1].style.display = "none"; } else { this.element.getElementsByClassName("lbl")[1].innerHTML = this.label2 + ":"; -- cgit v1.2.3 From fdfba499f0b84360b96096fa866a981e96e8756c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 16:35:56 -0700 Subject: fixing the color chip for the document root Signed-off-by: Valerio Virgillito --- js/panels/properties.reel/properties.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'js/panels') diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index 4d048472..eb362796 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -46,7 +46,7 @@ exports.Properties = Montage.create(Component, { prepareForDraw: { value : function() { - + this.eventManager.addEventListener("openDocument", this, false); this.eventManager.addEventListener("selectionChange", this, false); // This will be a toggle option @@ -54,8 +54,6 @@ exports.Properties = Montage.create(Component, { this.eventManager.addEventListener( "elementChanging", this, false); } - this.eventManager.addEventListener("openDocument", this, false); - this.elementId.element.addEventListener("blur", this, false); this.elementId.element.addEventListener("focus", this, false); this.elementId.element.addEventListener("keyup", this, false); @@ -70,6 +68,9 @@ exports.Properties = Montage.create(Component, { value: function() { this.eventManager.addEventListener( "elementChange", this, false); + // Save a reference of the pi inside the document view to be able to clear + this.application.ninja.currentDocument.model.views.design.propertiesPanel = this; + // Display the default document root PI this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); } @@ -165,6 +166,15 @@ exports.Properties = Montage.create(Component, { } }, + clear: { + value: function() { + this.elementName.value = ""; + this.elementId.value = ""; + this.elementClass.value = ""; + this.customPi = null; + } + }, + displayElementProperties: { value: function (el) { var customPI, currentValue, isRoot = this.application.ninja.selectionController.isDocument; @@ -210,9 +220,16 @@ exports.Properties = Montage.create(Component, { this.displayCustomProperties(el, el.elementModel.pi); } + // Root element color chip if(isRoot) { var backgroundChip = this.customSections[0].content.controls["background"]; - if(backgroundChip) backgroundChip.color = ElementsMediator.getProperty(el, "background"); + var rootBackgroundColor = ElementsMediator.getProperty(el, "background"); + + if(rootBackgroundColor) { + backgroundChip.color = rootBackgroundColor; + } else { + backgroundChip.color = null; + } } var previousInput = this.application.ninja.colorController.colorModel.input; -- cgit v1.2.3 From ca70f18a62a2a2b5670be132361e3a3f5907d920 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 18 May 2012 17:12:37 -0700 Subject: Fixing radio control in the PI. Signed-off-by: Nivesh Rajbhandari --- js/panels/properties.reel/properties.css | 1 + 1 file changed, 1 insertion(+) (limited to 'js/panels') diff --git a/js/panels/properties.reel/properties.css b/js/panels/properties.reel/properties.css index 3166a1ff..84f52ed4 100755 --- a/js/panels/properties.reel/properties.css +++ b/js/panels/properties.reel/properties.css @@ -285,6 +285,7 @@ padding-right:6px; .propertiesPanel input[type='radio'].nj-skinned { text-indent: 0px; line-height: 5px; + margin: -4px 0 0 0; } .propertiesPanel input[type='radio'].nj-skinned label { -- cgit v1.2.3