diff options
author | Jose Antonio Marquez | 2012-07-20 17:06:40 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-07-20 17:06:40 -0700 |
commit | 5a4100de56bac351d7ee677bc85257ded5f5aee1 (patch) | |
tree | b791db1b53f1f04555d1ea247f4e16db1c546eec /js/panels/Materials | |
parent | f0e931e9a917d89e02e946bd6b2f2eae04510439 (diff) | |
parent | a9b17cef34d3c4f222b6f4d0949fa3c2bbfe867b (diff) | |
download | ninja-5a4100de56bac351d7ee677bc85257ded5f5aee1.tar.gz |
Merge branch 'refs/heads/Ninja-Master' into Document
Diffstat (limited to 'js/panels/Materials')
-rwxr-xr-x | js/panels/Materials/materials-library-panel.reel/materials-library-panel.js | 20 |
1 files changed, 16 insertions, 4 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 4b9044ae..c3c2a6de 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 | |||
@@ -217,15 +217,27 @@ exports.MaterialsLibraryPanel = Montage.create(Component, { | |||
217 | 217 | ||
218 | willPositionPopup: { | 218 | willPositionPopup: { |
219 | value: function(popup, defaultPosition) { | 219 | value: function(popup, defaultPosition) { |
220 | var content = popup.content.element, | 220 | var left, |
221 | top, | ||
222 | content = popup.content.element, | ||
221 | contentHt = parseFloat(content.style.height) || content.offsetHeight || 0, | 223 | contentHt = parseFloat(content.style.height) || content.offsetHeight || 0, |
222 | contentWd = parseFloat(content.style.width) || content.offsetWidth || 0, | 224 | contentWd = parseFloat(content.style.width) || content.offsetWidth || 0, |
223 | pt = webkitConvertPointFromNodeToPage(this.selectedMaterialNode, new WebKitPoint(0, 0)); | 225 | pt = webkitConvertPointFromNodeToPage(this.selectedMaterialNode, new WebKitPoint(0, 0)); |
224 | if(!pt) { | 226 | |
227 | if(!pt) { | ||
225 | return defaultPosition; | 228 | return defaultPosition; |
226 | } else { | 229 | } |
227 | return {top: pt.y - contentHt + 10, left: pt.x - contentWd + 10}; | 230 | |
231 | top = pt.y - contentHt + 10; | ||
232 | if(top < 0) { | ||
233 | top = 0; | ||
228 | } | 234 | } |
235 | left = pt.x - contentWd + 10; | ||
236 | if(left < 0) { | ||
237 | left = 0; | ||
238 | } | ||
239 | |||
240 | return {top:top, left:left}; | ||
229 | } | 241 | } |
230 | } | 242 | } |
231 | }); | 243 | }); |