From 515d949f753a534002eb35e1dc1348571d0d1a40 Mon Sep 17 00:00:00 2001 From: sandb Date: Wed, 30 Dec 2009 11:52:33 +0100 Subject: [PATCH] firefox bugfix, mousemove no longer crashes js on client --- js/pamela-buttons.js | 4 ++-- js/pamela.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/pamela-buttons.js b/js/pamela-buttons.js index 7e95c1f..f174661 100644 --- a/js/pamela-buttons.js +++ b/js/pamela-buttons.js @@ -138,14 +138,14 @@ IFaceButtons.prototype.draw = function() { IFaceButtons.prototype.mousemove = function(event) { for (var i =0; i < this.buttons.length; i++) { var b = this.buttons[i]; - b.isHover = b.isHovered(event.offsetX, event.offsetY); + b.isHover = b.isHovered(event.clientX, event.clientY); } }; IFaceButtons.prototype.mouseclick = function(event) { for (var i =0; i < this.buttons.length; i++) { var b = this.buttons[i]; - if (b.isHovered(event.offsetX, event.offsetY)) + if (b.isHovered(event.clientX, event.clientY)) b.execute(); } }; diff --git a/js/pamela.js b/js/pamela.js index 22d14a3..98fd0d5 100644 --- a/js/pamela.js +++ b/js/pamela.js @@ -115,8 +115,8 @@ Pamela.prototype.start = function() { Pamela.prototype.mousemove = function(event) { this.buttons.mousemove(event); - this.mouse.x = event.offsetX; - this.mouse.y = event.offsetY; + this.mouse.x = event.clientX; + this.mouse.y = event.clientY; }; Pamela.prototype.mouseclick = function(event) { @@ -195,7 +195,7 @@ Pamela.prototype.updateEntries = function() { $.getJSON("macs.php", function(data) { self.updateNodes(data); }); - self.entriesTimer = setTimeout(function() { self.updateEntries(); }, 60000); + self.entriesTimer = setTimeout(function() { self.updateEntries(); }, 20000); }; $(document).ready(function() {