diff options
Diffstat (limited to 'js/panels/Materials')
-rw-r--r-- | js/panels/Materials/materials-data.json | 18 | ||||
-rwxr-xr-x | js/panels/Materials/materials-library-panel.reel/materials-library-panel.js | 14 |
2 files changed, 26 insertions, 6 deletions
diff --git a/js/panels/Materials/materials-data.json b/js/panels/Materials/materials-data.json index abdacbe1..6fe5da69 100644 --- a/js/panels/Materials/materials-data.json +++ b/js/panels/Materials/materials-data.json | |||
@@ -5,10 +5,18 @@ | |||
5 | "label": "Ninja Materials", | 5 | "label": "Ninja Materials", |
6 | "children": [ | 6 | "children": [ |
7 | { | 7 | { |
8 | "label": "Blue Sky", | ||
9 | "id" : "Blue Sky" | ||
10 | }, | ||
11 | { | ||
8 | "label": "Bump Metal", | 12 | "label": "Bump Metal", |
9 | "id" : "Bump Metal" | 13 | "id" : "Bump Metal" |
10 | }, | 14 | }, |
11 | { | 15 | { |
16 | "label": "Dark Blur", | ||
17 | "id" : "Dark Blur" | ||
18 | }, | ||
19 | { | ||
12 | "label": "Flag", | 20 | "label": "Flag", |
13 | "id" : "Flag" | 21 | "id" : "Flag" |
14 | }, | 22 | }, |
@@ -17,10 +25,6 @@ | |||
17 | "id" : "Linear Gradient" | 25 | "id" : "Linear Gradient" |
18 | }, | 26 | }, |
19 | { | 27 | { |
20 | "label": "Paris", | ||
21 | "id" : "Paris" | ||
22 | }, | ||
23 | { | ||
24 | "label": "Plasma", | 28 | "label": "Plasma", |
25 | "id" : "Plasma" | 29 | "id" : "Plasma" |
26 | }, | 30 | }, |
@@ -29,6 +33,10 @@ | |||
29 | "id" : "Pulse" | 33 | "id" : "Pulse" |
30 | }, | 34 | }, |
31 | { | 35 | { |
36 | "label": "Radial Blur", | ||
37 | "id" : "Radial Blur" | ||
38 | }, | ||
39 | { | ||
32 | "label": "Radial Gradient", | 40 | "label": "Radial Gradient", |
33 | "id" : "Radial Gradient" | 41 | "id" : "Radial Gradient" |
34 | }, | 42 | }, |
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js index aef48230..4b9044ae 100755 --- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js +++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js | |||
@@ -116,6 +116,14 @@ exports.MaterialsLibraryPanel = Montage.create(Component, { | |||
116 | handleShowMaterialPopup: { | 116 | handleShowMaterialPopup: { |
117 | enumerable: false, | 117 | enumerable: false, |
118 | value: function (event) { | 118 | value: function (event) { |
119 | var piButton = this.application.eventManager.componentClaimingPointer("mouse"); | ||
120 | if(piButton) { | ||
121 | this.selectedMaterialNode = piButton.element; | ||
122 | } else { | ||
123 | this.selectedMaterialNode = null; | ||
124 | } | ||
125 | |||
126 | this.materialId = event.detail.materialId; | ||
119 | this._showMaterialPopup(event.detail); | 127 | this._showMaterialPopup(event.detail); |
120 | } | 128 | } |
121 | }, | 129 | }, |
@@ -213,7 +221,11 @@ exports.MaterialsLibraryPanel = Montage.create(Component, { | |||
213 | contentHt = parseFloat(content.style.height) || content.offsetHeight || 0, | 221 | contentHt = parseFloat(content.style.height) || content.offsetHeight || 0, |
214 | contentWd = parseFloat(content.style.width) || content.offsetWidth || 0, | 222 | contentWd = parseFloat(content.style.width) || content.offsetWidth || 0, |
215 | pt = webkitConvertPointFromNodeToPage(this.selectedMaterialNode, new WebKitPoint(0, 0)); | 223 | pt = webkitConvertPointFromNodeToPage(this.selectedMaterialNode, new WebKitPoint(0, 0)); |
216 | return {top: pt.y - contentHt + 10, left: pt.x - contentWd + 10}; | 224 | if(!pt) { |
225 | return defaultPosition; | ||
226 | } else { | ||
227 | return {top: pt.y - contentHt + 10, left: pt.x - contentWd + 10}; | ||
228 | } | ||
217 | } | 229 | } |
218 | } | 230 | } |
219 | }); | 231 | }); |