Commit f270cda0 authored by webchick's avatar webchick

#350275 by mfer: Fix regression in tablesort after introduction of jQuery 1.3.2.

parent fe1c55ed
......@@ -523,7 +523,16 @@ Drupal.tableDrag.prototype.findDropTargetRow = function(x, y) {
var row = rows[n];
var indentDiff = 0;
var rowY = $(row).offset().top;
var rowHeight = parseInt($(row).outerHeight()) / 2;
// Because Safari does not report offsetHeight on table rows, but does on
// table cells, grab the firstChild of the row and use that instead.
// http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari.
if (row.offsetHeight == 0) {
var rowHeight = parseInt(row.firstChild.offsetHeight) / 2;
}
// Other browsers.
else {
var rowHeight = parseInt(row.offsetHeight) / 2;
}
// Because we always insert before, we need to offset the height a bit.
if ((y > (rowY - rowHeight)) && (y < (rowY + rowHeight))) {
......@@ -1074,4 +1083,4 @@ Drupal.theme.prototype.tableDragChangedWarning = function () {
return '<div class="warning">' + Drupal.theme('tableDragChangedMarker') + ' ' + Drupal.t("Changes made in this table will not be saved until the form is submitted.") + '</div>';
};
})(jQuery);
\ No newline at end of file
})(jQuery);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment