diff options
author | Jose Antonio Marquez | 2012-07-20 09:52:03 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-07-20 09:52:03 -0700 |
commit | 5d82978e9a0e0daf7c457ff87be95a3b4301999e (patch) | |
tree | 906f908fef755b8e0f57ab7a0d9ce348c398958b /js/panels/Materials/materials-library-panel.reel | |
parent | a8b7648d2c1305eb068d42ebde9b042ee6de72ab (diff) | |
parent | 9053e2037821a5c8405fabb74db9635deacfe8d5 (diff) | |
download | ninja-5d82978e9a0e0daf7c457ff87be95a3b4301999e.tar.gz |
Merge branch 'refs/heads/Ninja-Master' into Document
Diffstat (limited to 'js/panels/Materials/materials-library-panel.reel')
-rwxr-xr-x | js/panels/Materials/materials-library-panel.reel/materials-library-panel.js | 14 |
1 files changed, 13 insertions, 1 deletions
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 | }); |