From a36cff7b1035b3d3b3441f12ea4eb647b25bdad6 Mon Sep 17 00:00:00 2001 From: vChabot Date: Thu, 3 Nov 2011 09:20:31 +0000 Subject: [PATCH] // attributes positions and groups attributes positions are now working fine with new tab --- .../template/helper/list/list_action_details.tpl | 1 + js/admin-dnd.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/admin-dev/themes/template/helper/list/list_action_details.tpl b/admin-dev/themes/template/helper/list/list_action_details.tpl index 88e35c8dc..4a10924d8 100644 --- a/admin-dev/themes/template/helper/list/list_action_details.tpl +++ b/admin-dev/themes/template/helper/list/list_action_details.tpl @@ -99,6 +99,7 @@ $(document).ready(function() { } this.dataMaped = true; this.opened = false; + initTableDnD('.details_{$id} table.tableDnD'); } }); } diff --git a/js/admin-dnd.js b/js/admin-dnd.js index ba076d6b7..c722625ca 100644 --- a/js/admin-dnd.js +++ b/js/admin-dnd.js @@ -25,11 +25,17 @@ */ $(document).ready(function() { - $('table.tableDnD').tableDnD({ - +initTableDnD(); +}) + +function initTableDnD(table) +{ + if (typeof(table) == 'undefined') + table = 'table.tableDnD'; + $(table).tableDnD({ onDragStart: function(table, row) { originalOrder = $.tableDnD.serialize(); - reOrder = ':even'; + reOrder = ':even';console.log(table.tBodies[0].rows[1]); if (table.tBodies[0].rows[1] && $('#' + table.tBodies[0].rows[1].id).hasClass('alt_row')) reOrder = ':odd'; $('#'+table.id+ '#' + row.id).parent('tr').addClass('myDragClass'); @@ -203,4 +209,4 @@ $(document).ready(function() { } } }); -}) +} \ No newline at end of file