1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-18 11:52:11 +01:00

Fix: Ie9 throws an error when document.activeElement is used inside a frame or iframe... So need to wrap the test up in a try/catch. Nasty.

This commit is contained in:
Allan Jardine 2012-09-23 13:12:39 +01:00
parent bd6bb74967
commit 26d2926390
2 changed files with 18 additions and 4 deletions

View File

@ -5622,8 +5622,15 @@
var n = oSettings.aanFeatures.f; var n = oSettings.aanFeatures.f;
for ( var i=0, iLen=n.length ; i<iLen ; i++ ) for ( var i=0, iLen=n.length ; i<iLen ; i++ )
{ {
if ( n[i]._DT_Input != document.activeElement ) // IE9 throws an 'unknown error' if document.activeElement is used
{ // inside an iframe...
try {
if ( n[i]._DT_Input != document.activeElement )
{
$(n[i]._DT_Input).val( sInput );
}
}
catch ( e ) {
$(n[i]._DT_Input).val( sInput ); $(n[i]._DT_Input).val( sInput );
} }
} }

View File

@ -683,8 +683,15 @@ this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseIns
var n = oSettings.aanFeatures.f; var n = oSettings.aanFeatures.f;
for ( var i=0, iLen=n.length ; i<iLen ; i++ ) for ( var i=0, iLen=n.length ; i<iLen ; i++ )
{ {
if ( n[i]._DT_Input != document.activeElement ) // IE9 throws an 'unknown error' if document.activeElement is used
{ // inside an iframe or frame...
try {
if ( n[i]._DT_Input != document.activeElement )
{
$(n[i]._DT_Input).val( sInput );
}
}
catch ( e ) {
$(n[i]._DT_Input).val( sInput ); $(n[i]._DT_Input).val( sInput );
} }
} }