From e96c202a3500e1a6a9744313d6acf99019b4559c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 15 Jul 2008 01:54:41 +0000 Subject: [PATCH] Magnifier: Partial cleanup. --- ui/ui.magnifier.js | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/ui/ui.magnifier.js b/ui/ui.magnifier.js index 754db9273..f49f8489f 100644 --- a/ui/ui.magnifier.js +++ b/ui/ui.magnifier.js @@ -19,13 +19,21 @@ $.widget("ui.magnifier", { var self = this, o = this.options; - this.element.addClass("ui-magnifier"); + this.element + .addClass("ui-magnifier") + .bind('click.magnifier', function(e) { + (!self.disabled && o.click && o.click.apply(this, [e, { + options: self.options, + current: self.current[0], + currentOffset: self.current[1] + }])); + }); + + // the element must have relative or absolute positioning if (!(/^(r|a)/).test(this.element.css("position"))) { this.element.css("position", "relative"); } - this.pp = this.element.offset(); - this.items = []; this.element.find(o.items).each(function() { var $this = $(this); @@ -40,33 +48,21 @@ $.widget("ui.magnifier", { (o.opacity && $this.css('opacity', o.opacity.min)); }); - if (o.overlap) { - for (var i=0; i