Bug fix and comments to Util.mouseLeft().

git-svn-id: http://svn.openlayers.org/trunk/openlayers@307 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-05-24 03:14:05 +00:00
parent 259c17106e
commit 0b7d1e6e1e

View File

@@ -758,9 +758,12 @@ OpenLayers.Util.getTagText = function (parent, item, index) {
* @return {boolean}
*/
OpenLayers.Util.mouseLeft = function (evt, div) {
// start with the element to which the mouse has moved
var target = (evt.relatedTarget) ? evt.relatedTarget : evt.toElement;
while (target != div && target.nodeName != 'BODY') {
// walk up the DOM tree.
while (target != div && target != document.documentElement) {
target = target.parentNode;
}
return (target == div);
// if the target we stop at isn't the div, then we've left the div.
return (target != div);
};