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/properties.reel') 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 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/properties.reel') 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/properties.reel') 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/properties.reel') 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 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/properties.reel') 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