Issue 2821: prevented caling blur() on a body element, causes bug in IE8

This commit is contained in:
Petko Bossakov 2011-11-02 22:09:25 +02:00
parent 85927d3995
commit 8387919d26

View file

@ -1089,7 +1089,13 @@
// Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement
// is undefined when we are in an IFrame.
try {
$( document.activeElement || "" ).add( "input:focus, textarea:focus, select:focus" ).blur();
if(document.activeElement) {
if(document.activeElement.nodeName.toLowerCase() != 'body') {
document.activeElement.blur();
}
} else {
$( "input:focus, textarea:focus, select:focus" ).blur();
}
} catch(e) {}
// If we're displaying the page as a dialog, we don't want the url