Ticket #1034: pagePosition.patch
| File pagePosition.patch, 1.4 kB (added by crschmidt, 1 year ago) |
|---|
-
tests/test_Util.html
old new 19 19 OpenLayers.Util.removeItem(array, 3); 20 20 t.eq( array.toString(), "1,2,4,5", "Util.removeItem works"); 21 21 } 22 23 function test_03_Util_pagePosition(t) { 24 t.plan( 1 ); 25 var pp = OpenLayers.Util.pagePosition(window); 26 t.eq( pp.toString(), "0,0", "Page position doesn't bail if passed 'window'") 27 28 } 22 29 23 30 function test_04_Util_createDiv(t) { 24 31 t.plan( 24 ); -
lib/OpenLayers/Util.js
old new 991 991 while(element) { 992 992 993 993 if(element == document.body) { 994 if(OpenLayers.Element.getStyle(child, 'position') == 'absolute') { 994 // FIXME: IE, when passed 'window' as the forElement, treats it as 995 // equal to document.body, but window.style fails, so getStyle 996 // fails, so we are paranoid and check this here. This check should 997 // probably move into element.getStyle in 2.6. 998 if(child && child.style && 999 OpenLayers.Element.getStyle(child, 'position') == 'absolute') { 995 1000 break; 996 1001 } 997 1002 }
