From 9001f262af31ea728f93acd457e809a0b53aa0ca Mon Sep 17 00:00:00 2001 From: Jay Merrifield Date: Wed, 18 May 2011 15:14:48 -0400 Subject: [PATCH 1/3] Mouse: Optimize the cancel locator, works around a bug where .add(event.target) in IE8 can take a long time when there are multiple siblings, Fixes #7118 - IE Bug Large ComboBox (Dialog) --- ui/jquery.ui.mouse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 0bd38db8530..5d5ed008eec 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -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).parents(this.options.cancel).add($(event.target)).length : false); if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { return true; } From 5ecde332e23e395ebe73b711d9745465f6a39ad3 Mon Sep 17 00:00:00 2001 From: Jay Merrifield Date: Wed, 18 May 2011 15:18:18 -0400 Subject: [PATCH 2/3] Better test for if the event.target actually matches the cancel selector --- ui/jquery.ui.mouse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 5d5ed008eec..4c575bf290c 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -58,8 +58,8 @@ $.widget("ui.mouse", { var self = this, btnIsLeft = (event.which == 1), - elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents(this.options.cancel).add($(event.target)).length : false); - if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || $(event.target).is(this.options.cancel) || !this._mouseCapture(event)) { return true; } From a241b91b4742ee5a147e55560d81c992db10a555 Mon Sep 17 00:00:00 2001 From: Jay Merrifield Date: Thu, 26 May 2011 20:45:11 -0400 Subject: [PATCH 3/3] replace parents() with closest() since we only care about the first occurance --- ui/jquery.ui.mouse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 4c575bf290c..c72720eecd7 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -58,7 +58,7 @@ $.widget("ui.mouse", { var self = this, btnIsLeft = (event.which == 1), - elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents(this.options.cancel).length : false); + elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).closest(this.options.cancel).length : false); if (!btnIsLeft || elIsCancel || $(event.target).is(this.options.cancel) || !this._mouseCapture(event)) { return true; }