jBox now works when horizontally scrolled; fixed case matching inconsistency in autofill
authorDan
Fri, 30 Jul 2010 12:02:18 -0400
changeset 1272 05b7645f12e6
parent 1271 77accbee98f5
child 1273 3351055b467e
jBox now works when horizontally scrolled; fixed case matching inconsistency in autofill
includes/clientside/static/autofill.js
includes/clientside/static/dropdown.js
includes/clientside/static/functions.js
--- a/includes/clientside/static/autofill.js	Thu Jul 29 19:30:11 2010 -0400
+++ b/includes/clientside/static/autofill.js	Fri Jul 30 12:02:18 2010 -0400
@@ -38,6 +38,7 @@
 				},
 				tableHeader: '<tr><th>' + $lang.get('user_autofill_heading_suggestions') + '</th></tr>',
 				showWhenNoResults: true,
+				matchCase: true,
 				noResultsHTML: '<tr><td class="row1" style="font-size: smaller;">' + $lang.get('user_autofill_msg_no_suggestions') + '</td></tr>'
 		});
 	}
--- 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;
 	}
--- a/includes/clientside/static/functions.js	Thu Jul 29 19:30:11 2010 -0400
+++ b/includes/clientside/static/functions.js	Fri Jul 30 12:02:18 2010 -0400
@@ -546,6 +546,30 @@
 	return position;
 }
 
+function getXScrollOffset(el)
+{
+	var position;
+	var s = el || self;
+	el = el || document;
+	if ( el.scrollTop )
+	{
+		position = el.scrollLeft;
+	}
+	else if (s.pageYOffset)
+	{
+		position = self.pageXOffset;
+	}
+	else if (document.documentElement && document.documentElement.scrollLeft)
+	{
+		position = document.documentElement.scrollLeft;
+	}
+	else if (document.body)
+	{
+		position = document.body.scrollLeft;
+	}
+	return position;
+}
+
 function setScrollOffset(offset)
 {
 	window.scroll(0, offset);