Permalink
Browse files

Fix broken hover in WebKit after moving map

  • Loading branch information...
1 parent 790f12e commit e159425a6ad2db2b62429c0aa253727b78b1f8b6 @geary committed Feb 21, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 code/polygonzo.js
View
@@ -181,8 +181,9 @@ PolyGonzo = {
style.WebkitTransform ||
style.msTransform ||
style.MozTransform ||
- style.OTransform
- );
+ style.OTransform ||
+ ''
+ ).replace( / /g, '' );
};
this.getTransformOffset = function() {
@@ -193,11 +194,11 @@ PolyGonzo = {
if( ! parent ) return null;
var offsetter = parent.offsetParent;
var transform = this.getTransform( offsetter.style );
- var match = transform && transform.match(
- /translate\s*\(\s*(-?\d+)px\s*,\s*(-?\d+)px\s*\)/
+ var match = transform.match(
+ /matrix\(-?\d+,-?\d+,-?\d+,-?\d+,(-?\d+)(px)?,(-?\d+)(px)?\)/
);
var offset = match ?
- { x: +match[1], y: +match[2] } :
+ { x: +match[1], y: +match[3] } :
{ x: offsetter.offsetLeft, y: offsetter.offsetTop };
offset.isTransform = !! match;
return offset;

0 comments on commit e159425

Please sign in to comment.