Skip to content

Commit

Permalink
Dev: Remove use of getRootNode() its a new method that don't appear to
Browse files Browse the repository at this point in the history
work well across browsers.

- Using two different methods now - check that the node is in the body
  using a little jQuery
- And that there are actually rows in the table
  • Loading branch information
Allan Jardine committed Feb 22, 2017
1 parent 3eda01f commit b2738f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/dataTables.keyTable.js
Expand Up @@ -248,11 +248,15 @@ $.extend( KeyTable.prototype, {

var lastFocus = that.s.lastFocus;

if ( lastFocus && lastFocus.node.getRootNode() === document ) {
if ( lastFocus && lastFocus.node && $(lastFocus.node).closest('body') === document.body ) {
var relative = that.s.lastFocus.relative;
var info = dt.page.info();
var row = relative.row + info.start;

if ( info.recordsDisplay === 0 ) {
return;
}

// Reverse if needed
if ( row >= info.recordsDisplay ) {
row = info.recordsDisplay - 1;
Expand Down

0 comments on commit b2738f8

Please sign in to comment.