[hobbit] Fixing zoom in graphs for Firefox 3.0.18

Buchan Milne bgmilne at staff.telkomsa.net
Wed Apr 7 12:52:17 CEST 2010


On Wednesday, 7 April 2010 09:26:54 Kristian Nielsen wrote:
> 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.

I've never seen this myself, on various browsers (I'm currently using firefox 
3.5, chromium 5, konqueror from KDE 4.3.x, IE 7).

Are you starting your drag when the cursor is a pointer, and not a cross ? 
Shouldn't you just start your drag from inside the graph boundaries/axes 
(instead of over random parts of the image outside the graph boundaries)?

I guess if many people have this problem, it is worth fixing, but ... I've 
never had any new users to Xymon ask this.

> (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.

Regards,
Buchan



More information about the Xymon mailing list