From 2f80c18734253d78ad1fb4c216e395894625a998 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 4 Jun 2008 19:13:18 +0000 Subject: [PATCH] Mouse: trigger start on mouse down if distance 0 and delay 0; changed default distance to 1. --- ui/source/ui.core.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/source/ui.core.js b/ui/source/ui.core.js index 5fabd9ae8..c96426ac8 100644 --- a/ui/source/ui.core.js +++ b/ui/source/ui.core.js @@ -77,7 +77,7 @@ $.fn.remove = function() { // $.widget is a factory to create jQuery plugins // taking some boilerplate code out of the plugin code -// created by Scott González and Jörn Zaefferer +// created by Scott Gonz�lez and J�rn Zaefferer function getter(namespace, plugin, method) { var methods = $[namespace][plugin].getter || []; methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods); @@ -203,6 +203,11 @@ $.ui.mouse = { }, this.options.delay); } + if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) { + this._mouseStarted = (this.mouseStart(e) !== false); + if (!this._mouseStarted) { return false; } + } + // these delegates are required to keep context this._mouseMoveDelegate = function(e) { return self.mouseMove(e); @@ -270,7 +275,7 @@ $.ui.mouse = { $.ui.mouse.defaults = { cancel: null, - distance: 0, + distance: 1, delay: 0 }; -- 2.39.5