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)

(cherry picked from commit 09e88d6220)
This commit is contained in:
Jay Merrifield 2011-05-26 23:42:51 -04:00 committed by Scott González
parent b196d1fb61
commit b04c6ece34

View 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;
}