aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-09-29 23:19:19 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-09-29 23:19:19 -0700
commitd0bb2d30361c08f74d831b7abe2b2e7c479d0352 (patch)
tree6910aa2c4ddcf568af4cd94e25ad22c1e727621e /include
parentdda51954185ef5a1801ef2b9a2b99cb796399a91 (diff)
downloadvolse-hubzilla-d0bb2d30361c08f74d831b7abe2b2e7c479d0352.tar.gz
volse-hubzilla-d0bb2d30361c08f74d831b7abe2b2e7c479d0352.tar.bz2
volse-hubzilla-d0bb2d30361c08f74d831b7abe2b2e7c479d0352.zip
bloody ie8
Diffstat (limited to 'include')
-rw-r--r--include/main.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/main.js b/include/main.js
index 6d743c4f4..f87d87fb9 100644
--- a/include/main.js
+++ b/include/main.js
@@ -153,19 +153,18 @@
}
function getPosition(e) {
- e = e || window.event;
var cursor = {x:0, y:0};
- if ( e.pageX > 0 || e.pageY > 0 ) {
+ if ( e.pageX || e.pageY ) {
cursor.x = e.pageX;
cursor.y = e.pageY;
}
else {
- if( e.clientX > 0 || e.clientY > 0 ) {
- cursor.x = e.clientX;
- cursor.y = e.clientY;
+ if( e.clientX || e.clientY ) {
+ cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
+ cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
}
else {
- if( e.x > 0 || e.y > 0 ) {
+ if( e.x || e.y ) {
cursor.x = e.x;
cursor.y = e.y;
}
@@ -177,13 +176,14 @@
var lockvisible = false;
function lockview(event,id) {
+ event = event || window.event;
+ cursor = getPosition(event);
if(lockvisible) {
lockviewhide();
}
else {
lockvisible = true;
$.get('lockview/' + id, function(data) {
- cursor = getPosition(event);
$('#panel').html(data);
$('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
$('#panel').show();