All pastes #748765 Raw Edit

Anonymous

public javascript v1 · immutable
#748765 ·published 2007-10-25 03:17 UTC
rendered paste body
/*A row has just been indented or outdented. We're trying to find the new 'parent' of the row. Item B has just been moved.- Item- Item A - Item - Item  - Item  - Item C - Item BItem B was underneath Item C. Underneath Item C means there were 3 indents. Now it only has 1 indent. So we want Item B to find it's new parent, Item A.The final parent should end up in the 'sourceRow' variable.*/    else if (rowSettings.relationship == 'parent') {      var parents = this.indentCount - this.dragObject.indents;      var previousRow = $(changedRow).prev();      while (parents > 0) {        parents--;        while (previousRow.length && $('.indentation', previousRow).length < (this.dragObject.indents - parents)) {          previousRow = previousRow.prev();        }      }      sourceRow = previousRow[0] || changedRow;    }