renciso218 / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

IE doesn't support scrollX/Y property #164

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. open a sample blockly app with IE (any will do, I tested with IE 10)
2. click on a textfield or the color picker

What is the expected output? What do you see instead?

the editor/color picker should be placed above the field or close to it

the editor/color picker appears at the bottom because the XY coords are NaN 
since scrollX/Y are undefined and used during the calculation

Please use labels and text to provide additional information.

the fix is:

svn diff utils.js 
Index: utils.js
===================================================================
--- utils.js    (revision 1380)
+++ utils.js    (working copy)
@@ -300,8 +300,8 @@
   }
   var xy = svgPoint.matrixTransform(matrix);
   if (!toSvg) {
-    xy.x += window.scrollX;
-    xy.y += window.scrollY;
+    xy.x += window.scrollX || window.pageXOffset;
+    xy.y += window.scrollY || window.pageYOffset;
   }
   return xy;
 };

Original issue reported on code.google.com by luismarianoguerra@gmail.com on 25 Sep 2013 at 3:23

GoogleCodeExporter commented 8 years ago
Fixed in r1389.  Thanks for the patch!

Original comment by neil.fra...@gmail.com on 30 Sep 2013 at 10:16

GoogleCodeExporter commented 8 years ago
Issue 166 has been merged into this issue.

Original comment by neil.fra...@gmail.com on 30 Sep 2013 at 10:17