diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-17 02:59:27 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-17 02:59:27 +0000 |
commit | f270cda0707aff5804ea5bbfd3e44000eaa0d871 (patch) | |
tree | 3b533c7f6e48f16a95a8c6d0940245e2a574f5a0 /misc/tabledrag.js | |
parent | fe1c55ed286a3f86d4730be63d8edac7a192f2e5 (diff) | |
download | brdo-f270cda0707aff5804ea5bbfd3e44000eaa0d871.tar.gz brdo-f270cda0707aff5804ea5bbfd3e44000eaa0d871.tar.bz2 |
#350275 by mfer: Fix regression in tablesort after introduction of jQuery 1.3.2.
Diffstat (limited to 'misc/tabledrag.js')
-rw-r--r-- | misc/tabledrag.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/misc/tabledrag.js b/misc/tabledrag.js index d07b3c780..ace82cfc0 100644 --- a/misc/tabledrag.js +++ b/misc/tabledrag.js @@ -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); |