bloody ie8

This commit is contained in:
Mike Macgirvin 2010-09-29 23:19:19 -07:00
parent dda5195418
commit d0bb2d3036
1 changed files with 7 additions and 7 deletions

View File

@ -153,19 +153,18 @@
} }
function getPosition(e) { function getPosition(e) {
e = e || window.event;
var cursor = {x:0, y:0}; var cursor = {x:0, y:0};
if ( e.pageX > 0 || e.pageY > 0 ) { if ( e.pageX || e.pageY ) {
cursor.x = e.pageX; cursor.x = e.pageX;
cursor.y = e.pageY; cursor.y = e.pageY;
} }
else { else {
if( e.clientX > 0 || e.clientY > 0 ) { if( e.clientX || e.clientY ) {
cursor.x = e.clientX; cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
cursor.y = e.clientY; cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
} }
else { else {
if( e.x > 0 || e.y > 0 ) { if( e.x || e.y ) {
cursor.x = e.x; cursor.x = e.x;
cursor.y = e.y; cursor.y = e.y;
} }
@ -177,13 +176,14 @@
var lockvisible = false; var lockvisible = false;
function lockview(event,id) { function lockview(event,id) {
event = event || window.event;
cursor = getPosition(event);
if(lockvisible) { if(lockvisible) {
lockviewhide(); lockviewhide();
} }
else { else {
lockvisible = true; lockvisible = true;
$.get('lockview/' + id, function(data) { $.get('lockview/' + id, function(data) {
cursor = getPosition(event);
$('#panel').html(data); $('#panel').html(data);
$('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5}); $('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
$('#panel').show(); $('#panel').show();