From 1b261db0c8e4d703ff98ea4b784f9774130cd10e Mon Sep 17 00:00:00 2001 From: taggon Date: Fri, 23 Sep 2011 02:59:58 +0000 Subject: [PATCH] Fixed a bug that a ghost table row showed at wrong place in Firefox git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9294 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/admin/tpl/js/admin.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 93d8edf2a..6cdb234ef 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -554,13 +554,14 @@ $.fn.xeSortableTable = function(){ .not('.xe-sortable-table') .addClass('xe-sortable-table') .delegate('button.dragBtn', 'mousedown.st', function(event){ - var $this, $tr, $table, $th, height, width, offset, position, offsets, i, dropzone, cols; + var $this, $tr, $table, $th, height, width, offset, position, offsets, i, dropzone, cols, ofspar; if(event.which != 1) return; $this = $(this); $tr = $this.closest('tr'); - $table = $this.closest('table').css('position','relative'); + $table = $this.closest('table'); + ofspar = $table.get(0).offsetParent; height = $tr.height(); width = $tr.width(); @@ -572,7 +573,7 @@ $.fn.xeSortableTable = function(){ if(before_event.isDefaultPrevented()) return false; position = {x:event.pageX, y:event.pageY}; - offset = getOffset($tr.get(0), $table.get(0)); + offset = getOffset($tr.get(0), ofspar); $clone = $tr.attr('target', true).clone(true).appendTo($table); @@ -586,7 +587,7 @@ $.fn.xeSortableTable = function(){ $table.find('tbody>tr:not([target],.sticky,:hidden)').each(function() { var $this = $(this), o; - o = getOffset(this, $table.get(0)); + o = getOffset(this, ofspar); offsets.push({top:o.top, bottom:o.top+$this.height(), $item:$this}); });