From 6cfb6208ee121f21565a12f7bf2ca57bb074b44d Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 16 Jul 2008 00:08:43 +0000 Subject: Magnifier: Partial cleanup. --- ui/ui.magnifier.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/ui/ui.magnifier.js b/ui/ui.magnifier.js index 393a6b6f7..0dc8efbf1 100644 --- a/ui/ui.magnifier.js +++ b/ui/ui.magnifier.js @@ -99,15 +99,19 @@ $.widget("ui.magnifier", { var p = [e.pageX,e.pageY], o = this.options, c, distance = 1; this.current = this.items[0]; - //Compute the parents distance, because we don't need to fire anything if we are not near the parent - var overlap = ((p[0] > this.pp.left-o.distance && p[0] < this.pp.left + this.element[0].offsetWidth + o.distance) && (p[1] > this.pp.top-o.distance && p[1] < this.pp.top + this.element[0].offsetHeight + o.distance)); + // Compute the parent's distance + // we don't need to fire anything if we are not near the parent + var overlap = ((p[0] > this.pp.left-o.distance) && + (p[0] < this.pp.left + this.element[0].offsetWidth + o.distance) && + (p[1] > this.pp.top-o.distance) && + (p[1] < this.pp.top + this.element[0].offsetHeight + o.distance)); if (!overlap) { return false; } for (var i=0; i