Fixing zoom in graphs for Firefox 3.0.18

Kristian Nielsen knielsen at knielsen-hq.org
Wed Apr 7 10:26:54 CEST 2010


Hi,

For a long time I was unable to use the nifty zoom feature in the Hobbit/XYMon
graphs. The problem is that dragging the mouse invokes the browser image
drag-and-drop functionality, preventing the zoom.js machinery to do its work.

(So this is a different problem from what I read about in several threads,
with people getting a blue box instead of a working zoom image).

Today I finally decided to look into the problem, and found a fix. I though I
would post it, in case it should be helpful to others.

Basically, it's this one-line patch:

--- /etc/hobbit/web/zoom.js     2010/04/07 08:03:39     1.1
+++ /etc/hobbit/web/zoom.js     2010/04/07 08:06:10
@@ -550,6 +550,7 @@
    gMouseObj.dragging = true;
    gMouseObj.saveCurrentToStartPosition();
    gZoomGraphObj.drawSelection(gMouseObj.currentX, gMouseObj.currentY, gMouseObj.currentX, gMouseObj.currentY);
+   if (e.preventDefault) e.preventDefault();
   } else if (gMouseObj.rightButtonPressed()) {
    var test = true;
   }

I'm using hobbit 4.2.0 (and Firefox 3.0.18), so this is old stuff ... my
apologies if this is already fixed in a newer version.

Hope this helps,

 - Kristian



More information about the Xymon mailing list