Mouse: Work around a bug in IE 8 where disabled inputs don't have a nodeName. Fixes #7620 - Mouse: Error in IE 8 with disabled inputs.

(cherry picked from commit 7f812f8be9)
This commit is contained in:
Scott González 2011-08-09 09:32:01 -04:00
parent 3e98e73772
commit c5799b5141

View File

@ -58,7 +58,9 @@ $.widget("ui.mouse", {
var self = this, var self = this,
btnIsLeft = (event.which == 1), btnIsLeft = (event.which == 1),
elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).closest(this.options.cancel).length : false); // event.target.nodeName works around a bug in IE 8 with
// disabled inputs (#7620)
elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
return true; return true;
} }