aria.Grid.prototype.getNextCell = function()

in PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-hdinsight/hdinsight_jobview_html/com.microsoft.hdinsight/hdinsight/job/html/js/dataGrid.js [770:830]


 aria.Grid.prototype.getNextCell = function (
   currRow,
   currCol,
   directionX,
   directionY
 ) {
   var row = currRow + directionY;
   var col = currCol + directionX;
   var rowCount = this.grid.length;
   var isLeftRight = directionX !== 0;
 
   if (!rowCount) {
     return false;
   }
 
   var colCount = this.grid[0].length;
 
   if (this.shouldWrapCols && isLeftRight) {
     if (col < 0) {
       col = colCount - 1;
       row--;
     }
 
     if (col >= colCount) {
       col = 0;
       row++;
     }
   }
 
   if (this.shouldWrapRows && !isLeftRight) {
     if (row < 0) {
       col--;
       row = rowCount - 1;
       if (this.grid[row] && col >= 0 && !this.grid[row][col]) {
         // Sometimes the bottom row is not completely filled in. In this case,
         // jump to the next filled in cell.
         row--;
       }
     }
     else if (row >= rowCount || !this.grid[row][col]) {
       row = 0;
       col++;
     }
   }
 
   if (this.isValidCell(row, col)) {
     return {
       row: row,
       col: col
     };
   }
   else if (this.isValidCell(currRow, currCol)) {
     return {
       row: currRow,
       col: currCol
     };
   }
   else {
     return false;
   }
 };