Index: misc/tabledrag.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/tabledrag.js,v
retrieving revision 1.13
diff -u -r1.13 tabledrag.js
--- misc/tabledrag.js	19 Dec 2007 10:58:35 -0000	1.13
+++ misc/tabledrag.js	19 Dec 2007 13:43:39 -0000
@@ -73,10 +73,12 @@
     this.indentCount = 1; // Total width of indents, set in makeDraggable.
     // Find the width of indentations to measure mouse movements against.
     // Because the table doesn't need to start with any indentations, we
-    // manually create an empty div, check it's width, then remove.
-    var indent = $(Drupal.theme('tableDragIndentation')).appendTo('body');
-    this.indentAmount = parseInt(indent.css('width'));
-    indent.remove();
+    // manually append 2 indentations in the first draggable row, measure
+    // the offset, then remove.
+    var indent = Drupal.theme('tableDragIndentation');
+    var indentTest = $('tr.draggable:first td:first', table).prepend(indent).prepend(indent);
+    this.indentAmount = $('.indentation', indentTest).get(1).offsetLeft - $('.indentation', indentTest).get(0).offsetLeft;
+    indentTest.remove();
   }
 
   // Make each applicable row draggable.
@@ -403,7 +405,7 @@
     if (self.indentEnabled) {
       var xDiff = self.currentMouseCoords.x - self.dragObject.indentMousePos.x;
       // Set the number of indentations the mouse has been moved left or right.
-      var indentDiff = parseInt(xDiff / self.indentAmount * self.rtl);
+      var indentDiff = Math.round(xDiff / self.indentAmount * self.rtl);
       // Indent the row with our estimated diff, which may be further
       // restricted according to the rows around this row.
       var indentChange = self.rowObject.indent(indentDiff);
