includes/clientside/static/dropdown.js
changeset 1272 05b7645f12e6
parent 1265 7091cff2ca01
child 1353 1e8c224d47ef
--- a/includes/clientside/static/dropdown.js	Thu Jul 29 19:30:11 2010 -0400
+++ b/includes/clientside/static/dropdown.js	Fri Jul 30 12:02:18 2010 -0400
@@ -391,7 +391,7 @@
 
 function isOverObj(obj, bias, event)
 {
-	var fieldUL = new Object();
+	var fieldUL = {};
 	var dim = fetch_dimensions(obj);
 	var off = fetch_offset(obj);
 	fieldUL['top'] = off['top'];
@@ -399,13 +399,14 @@
 	fieldUL['right'] = off['left'] + dim['w'];
 	fieldUL['bottom'] = off['top'] + dim['h'];
 	
+	var mouseX_local = mouseX + getXScrollOffset();
 	var mouseY_local = mouseY + getScrollOffset();
 	
 	// document.getElementById('debug').innerHTML = '<br />Mouse: x: '+mouseX+', y:' + mouseY + '<br />' + document.getElementById('debug').innerHTML;
 	
 	if(bias)
 	{
-		if ( ( mouseX < fieldUL['left'] + 2 || mouseX > fieldUL['right']  - 5 ) ||
+		if ( ( mouseX_local < fieldUL['left'] + 2 || mouseX_local > fieldUL['right']  - 5 ) ||
  				( mouseY_local < fieldUL['top']  - 2 || mouseY_local > fieldUL['bottom'] - 2 ) )
 		{
  			return false;
@@ -413,7 +414,7 @@
 	}
 	else
 	{
-		if ( ( mouseX < fieldUL['left'] || mouseX > fieldUL['right']  ) ||
+		if ( ( mouseX_local < fieldUL['left'] || mouseX_local > fieldUL['right']  ) ||
  				( mouseY_local < fieldUL['top']  || mouseY_local > fieldUL['bottom'] ) )
  			return false;
 	}