rem: var rowIndents = $('.indentation', row).size(); var prevIndents = $('.indentation', $(row).prev('tr')).size(); var nextIndents = $('.indentation', $(row).next('tr')).size(); 
add: var prevRow, nextRow; if (this.direction == 'down') { prevRow = row; nextRow = $(row).next('tr').get(0); } else { prevRow = $(row).prev('tr').get(0); nextRow = row; } this.interval = this.validIndentInterval(prevRow, nextRow); 
context: Drupal.tableDrag.prototype.row.prototype.isValidSwap = function(row, indentDiff) {  if (this.indentEnabled) {    var rowIndents = $('.indentation', row).size();    var prevIndents = $('.indentation', $(row).prev('tr')).size();    var nextIndents = $('.indentation', $(row).next('tr')).size();    if (      (this.direction == 'down') && (        // Prevent being able to drag a row downward with 2 indentations from a parent.        this.indents > rowIndents + 1 ||        // Prevent orphaning children when dragging into a parent.        this.indents < nextIndents - indentDiff      ) ||      (this.direction == 'up') && (        // Prevent being able to drag a row upward with 2 indentations from a parent.        this.indents < rowIndents ||        // Prevent orphaning children when dragging between a child and parent.        this.indents > prevIndents + 1 - indentDiff      )    ) {      return false;    }  }  // Restriction special cases for the first row in the table.  if (this.table.tBodies[0].rows[0] == row) {    // Do not let the first row contain indentations    // or let an un-draggable first row have anything put before it.    if ((this.indents + indentDiff) > 0 || $(row).is(':not(.draggable)')) {      return false;    }  }  return true;};
meta: 639	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/639/ff6ce75f7b41eb8806b679d3901f7ac6cee8a6e8/tabledrag.js/buggy/misc/tabledrag.js