making clearMouseCache work when document.body is not ready, which fixes a regression. r=bartvde (closes #3189)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11730 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-03-28 13:52:59 +00:00
parent f88f6cd6ed
commit e8f79d95b1
2 changed files with 17 additions and 6 deletions

View File

@@ -860,10 +860,9 @@ OpenLayers.Events = OpenLayers.Class({
// returns incorrect offsets. So our best bet is to not invalidate the
// offsets once we have them, and hope that the page was not scrolled
// when we did the initial calculation.
if (!((document.body.scrollTop != 0 ||
document.body.scrollLeft != 0) &&
navigator.userAgent.match(/iPhone/i))) {
OpenLayers.Console.log("clear");
var body = document.body;
if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) &&
navigator.userAgent.match(/iPhone/i))) {
this.element.offsets = null;
}
},