includes/clientside/static/dropdown.js
changeset 1272 05b7645f12e6
parent 1265 7091cff2ca01
child 1353 1e8c224d47ef
equal deleted inserted replaced
1271:77accbee98f5 1272:05b7645f12e6
   389 	//obj.style.clip = 'rect('+height+'px,0px,'+maxheight+'px,auto);';
   389 	//obj.style.clip = 'rect('+height+'px,0px,'+maxheight+'px,auto);';
   390 }
   390 }
   391 
   391 
   392 function isOverObj(obj, bias, event)
   392 function isOverObj(obj, bias, event)
   393 {
   393 {
   394 	var fieldUL = new Object();
   394 	var fieldUL = {};
   395 	var dim = fetch_dimensions(obj);
   395 	var dim = fetch_dimensions(obj);
   396 	var off = fetch_offset(obj);
   396 	var off = fetch_offset(obj);
   397 	fieldUL['top'] = off['top'];
   397 	fieldUL['top'] = off['top'];
   398 	fieldUL['left'] = off['left'];
   398 	fieldUL['left'] = off['left'];
   399 	fieldUL['right'] = off['left'] + dim['w'];
   399 	fieldUL['right'] = off['left'] + dim['w'];
   400 	fieldUL['bottom'] = off['top'] + dim['h'];
   400 	fieldUL['bottom'] = off['top'] + dim['h'];
   401 	
   401 	
       
   402 	var mouseX_local = mouseX + getXScrollOffset();
   402 	var mouseY_local = mouseY + getScrollOffset();
   403 	var mouseY_local = mouseY + getScrollOffset();
   403 	
   404 	
   404 	// document.getElementById('debug').innerHTML = '<br />Mouse: x: '+mouseX+', y:' + mouseY + '<br />' + document.getElementById('debug').innerHTML;
   405 	// document.getElementById('debug').innerHTML = '<br />Mouse: x: '+mouseX+', y:' + mouseY + '<br />' + document.getElementById('debug').innerHTML;
   405 	
   406 	
   406 	if(bias)
   407 	if(bias)
   407 	{
   408 	{
   408 		if ( ( mouseX < fieldUL['left'] + 2 || mouseX > fieldUL['right']  - 5 ) ||
   409 		if ( ( mouseX_local < fieldUL['left'] + 2 || mouseX_local > fieldUL['right']  - 5 ) ||
   409  				( mouseY_local < fieldUL['top']  - 2 || mouseY_local > fieldUL['bottom'] - 2 ) )
   410  				( mouseY_local < fieldUL['top']  - 2 || mouseY_local > fieldUL['bottom'] - 2 ) )
   410 		{
   411 		{
   411  			return false;
   412  			return false;
   412 		}
   413 		}
   413 	}
   414 	}
   414 	else
   415 	else
   415 	{
   416 	{
   416 		if ( ( mouseX < fieldUL['left'] || mouseX > fieldUL['right']  ) ||
   417 		if ( ( mouseX_local < fieldUL['left'] || mouseX_local > fieldUL['right']  ) ||
   417  				( mouseY_local < fieldUL['top']  || mouseY_local > fieldUL['bottom'] ) )
   418  				( mouseY_local < fieldUL['top']  || mouseY_local > fieldUL['bottom'] ) )
   418  			return false;
   419  			return false;
   419 	}
   420 	}
   420  		
   421  		
   421 	return true;
   422 	return true;