diff options
Diffstat (limited to 'js/panels')
6 files changed, 62 insertions, 32 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/properties.reel/properties.css b/js/panels/properties.reel/properties.css index 5306eb5b..84f52ed4 100755 --- a/js/panels/properties.reel/properties.css +++ b/js/panels/properties.reel/properties.css | |||
@@ -285,6 +285,7 @@ padding-right:6px; | |||
285 | .propertiesPanel input[type='radio'].nj-skinned { | 285 | .propertiesPanel input[type='radio'].nj-skinned { |
286 | text-indent: 0px; | 286 | text-indent: 0px; |
287 | line-height: 5px; | 287 | line-height: 5px; |
288 | margin: -4px 0 0 0; | ||
288 | } | 289 | } |
289 | 290 | ||
290 | .propertiesPanel input[type='radio'].nj-skinned label { | 291 | .propertiesPanel input[type='radio'].nj-skinned label { |
@@ -303,4 +304,34 @@ input label { | |||
303 | .propertiesPanel .rotation .fieldRow { | 304 | .propertiesPanel .rotation .fieldRow { |
304 | -webkit-box-flex:0; | 305 | -webkit-box-flex:0; |
305 | width:45px; | 306 | width:45px; |
307 | } | ||
308 | |||
309 | .propertiesPanel div.montage-button:disabled { | ||
310 | opacity: 0.4; | ||
311 | } | ||
312 | |||
313 | .propertiesPanel div.montage-button { | ||
314 | font-size: 9px; | ||
315 | cursor: pointer; | ||
316 | display: block; | ||
317 | margin: -3px 0 0 -12px; | ||
318 | padding: 4px; | ||
319 | border: 1px #313131 solid; | ||
320 | background-color: #474747; | ||
321 | background-image: -webkit-linear-gradient(top, #505050 0%, #3c3c3c 100%); | ||
322 | border-radius: 4px; | ||
323 | color: white; | ||
324 | text-transform: uppercase; | ||
325 | cursor: pointer; | ||
326 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5); | ||
327 | width: 18px; | ||
328 | height: 14px; | ||
329 | } | ||
330 | |||
331 | .propertiesPanel div.montage-button:active { | ||
332 | background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #505050 100%); | ||
333 | } | ||
334 | |||
335 | .propertiesPanel div.montage-button:hover { | ||
336 | -webkit-box-shadow: 0px 0px 3px #b4b4b4; | ||
306 | } \ No newline at end of file | 337 | } \ No newline at end of file |
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index fa62c850..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, { | |||
46 | 46 | ||
47 | prepareForDraw: { | 47 | prepareForDraw: { |
48 | value : function() { | 48 | value : function() { |
49 | 49 | this.eventManager.addEventListener("openDocument", this, false); | |
50 | this.eventManager.addEventListener("selectionChange", this, false); | 50 | this.eventManager.addEventListener("selectionChange", this, false); |
51 | 51 | ||
52 | // This will be a toggle option | 52 | // This will be a toggle option |
@@ -54,9 +54,6 @@ exports.Properties = Montage.create(Component, { | |||
54 | this.eventManager.addEventListener( "elementChanging", this, false); | 54 | this.eventManager.addEventListener( "elementChanging", this, false); |
55 | } | 55 | } |
56 | 56 | ||
57 | this.eventManager.addEventListener("openDocument", this, false); | ||
58 | this.eventManager.addEventListener("switchDocument", this, false); | ||
59 | |||
60 | this.elementId.element.addEventListener("blur", this, false); | 57 | this.elementId.element.addEventListener("blur", this, false); |
61 | this.elementId.element.addEventListener("focus", this, false); | 58 | this.elementId.element.addEventListener("focus", this, false); |
62 | this.elementId.element.addEventListener("keyup", this, false); | 59 | this.elementId.element.addEventListener("keyup", this, false); |
@@ -71,26 +68,14 @@ exports.Properties = Montage.create(Component, { | |||
71 | value: function() { | 68 | value: function() { |
72 | this.eventManager.addEventListener( "elementChange", this, false); | 69 | this.eventManager.addEventListener( "elementChange", this, false); |
73 | 70 | ||
71 | // Save a reference of the pi inside the document view to be able to clear | ||
72 | this.application.ninja.currentDocument.model.views.design.propertiesPanel = this; | ||
73 | |||
74 | // Display the default document root PI | 74 | // Display the default document root PI |
75 | this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); | 75 | this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); |
76 | } | 76 | } |
77 | }, | 77 | }, |
78 | 78 | ||
79 | handleSwitchDocument: { | ||
80 | value: function(){ | ||
81 | // For now always assume that the stage is selected by default | ||
82 | if(this.application.ninja.selectedElements.length === 0) { | ||
83 | this.displayStageProperties(); | ||
84 | } else { | ||
85 | if(this.application.ninja.selectedElements.length === 1) { | ||
86 | this.displayElementProperties(this.application.ninja.selectedElements[0]); | ||
87 | } else { | ||
88 | this.displayGroupProperties(this.application.ninja.selectedElements); | ||
89 | } | ||
90 | } | ||
91 | } | ||
92 | }, | ||
93 | |||
94 | /** | 79 | /** |
95 | * Blur and Key up to handle change in the Element ID field. | 80 | * Blur and Key up to handle change in the Element ID field. |
96 | */ | 81 | */ |
@@ -181,6 +166,15 @@ exports.Properties = Montage.create(Component, { | |||
181 | } | 166 | } |
182 | }, | 167 | }, |
183 | 168 | ||
169 | clear: { | ||
170 | value: function() { | ||
171 | this.elementName.value = ""; | ||
172 | this.elementId.value = ""; | ||
173 | this.elementClass.value = ""; | ||
174 | this.customPi = null; | ||
175 | } | ||
176 | }, | ||
177 | |||
184 | displayElementProperties: { | 178 | displayElementProperties: { |
185 | value: function (el) { | 179 | value: function (el) { |
186 | var customPI, currentValue, isRoot = this.application.ninja.selectionController.isDocument; | 180 | var customPI, currentValue, isRoot = this.application.ninja.selectionController.isDocument; |
@@ -226,9 +220,16 @@ exports.Properties = Montage.create(Component, { | |||
226 | this.displayCustomProperties(el, el.elementModel.pi); | 220 | this.displayCustomProperties(el, el.elementModel.pi); |
227 | } | 221 | } |
228 | 222 | ||
223 | // Root element color chip | ||
229 | if(isRoot) { | 224 | if(isRoot) { |
230 | var backgroundChip = this.customSections[0].content.controls["background"]; | 225 | var backgroundChip = this.customSections[0].content.controls["background"]; |
231 | if(backgroundChip) backgroundChip.color = ElementsMediator.getProperty(el, "background"); | 226 | var rootBackgroundColor = ElementsMediator.getProperty(el, "background"); |
227 | |||
228 | if(rootBackgroundColor) { | ||
229 | backgroundChip.color = rootBackgroundColor; | ||
230 | } else { | ||
231 | backgroundChip.color = null; | ||
232 | } | ||
232 | } | 233 | } |
233 | 234 | ||
234 | var previousInput = this.application.ninja.colorController.colorModel.input; | 235 | var previousInput = this.application.ninja.colorController.colorModel.input; |
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 @@ | |||
22 | "element": { "#": "slotElement" } | 22 | "element": { "#": "slotElement" } |
23 | }, | 23 | }, |
24 | "bindings": { | 24 | "bindings": { |
25 | "content" : { | 25 | "content": {"<-": "@owner.content"} |
26 | "boundObject": {"@": "owner"}, | ||
27 | "boundObjectPropertyPath": "content" | ||
28 | } | ||
29 | } | 26 | } |
30 | }, | 27 | }, |
31 | "slot2": { | 28 | "slot2": { |
@@ -34,10 +31,7 @@ | |||
34 | "element": { "#": "slotElement2" } | 31 | "element": { "#": "slotElement2" } |
35 | }, | 32 | }, |
36 | "bindings": { | 33 | "bindings": { |
37 | "content" : { |