]> source.dussan.org Git - jquery-ui.git/commitdiff
Mouse: Optimize the cancel locator, works around a bug where .add(event.target) in...
authorJay Merrifield <merrifieldj@pixia.com>
Fri, 27 May 2011 03:42:51 +0000 (23:42 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 27 May 2011 03:44:05 +0000 (23:44 -0400)
(cherry picked from commit 09e88d6220af2f90197c826ac3a31a0ca97f2c8f)

ui/jquery.ui.mouse.js

index 0bd38db8530bf32dec3b44e0081c6f0377b17bfb..2fb1389f2b8ba652a23ccdff2aa675a3ab121e17 100644 (file)
@@ -58,7 +58,7 @@ $.widget("ui.mouse", {
 
                var self = this,
                        btnIsLeft = (event.which == 1),
-                       elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+                       elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).closest(this.options.cancel).length : false);
                if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
                        return true;
                }