summaryrefslogtreecommitdiff
path: root/misc/tabledrag.js
diff options
context:
space:
mode:
Diffstat (limited to 'misc/tabledrag.js')
-rw-r--r--misc/tabledrag.js13
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);