From 7c890a0daa023b01c782d9395c2d5e01bbae8af6 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Tue, 28 Sep 2010 18:00:59 +0000
Subject: [PATCH] Same but using style instead of hard coded cell

---
 htdocs/core/class/commonobject.class.php | 12 ++++++------
 htdocs/core/tpl/ajaxrow.tpl.php          | 10 +++++-----
 htdocs/theme/auguria/style.css.php       | 14 ++++++++++++--
 htdocs/theme/eldy/style.css.php          |  5 ++++-
 htdocs/theme/freelug/style.css.php       | 14 ++++++++++++--
 htdocs/theme/yellow/style.css.php        | 15 +++++++++++++--
 6 files changed, 52 insertions(+), 18 deletions(-)

diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 114166e42b4..b4f5bfb6db0 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -34,10 +34,10 @@
 class CommonObject
 {
 	var $db;
-	
+
 	// Instantiate hook classe of thirdparty module
 	var $hooks=array();
-	
+
 	/**
 	 *    Constructeur de la classe
 	 *    @param	DB		Handler acces base de donnees
@@ -778,15 +778,15 @@ class CommonObject
 			dol_print_error($this->db);
 		}
 	}
-	
+
 	/**
 	 * 	   Update position of line with ajax (rang)
 	 */
 	function line_ajaxorder($roworder)
-	{	
+	{
 		$rows = explode(',',$roworder);
 		$num = count($rows);
-		
+
 		for ($i = 0 ; $i < $num ; $i++)
 		{
 			$this->updateRangOfLine($rows[$i], ($i+1));
@@ -1376,7 +1376,7 @@ class CommonObject
 		print '<td align="right" width="50">'.$langs->trans('TotalHTShort').'</td>';
 		print '<td width="10">&nbsp;</td>';
 		print '<td width="10">&nbsp;</td>';
-		print '<td width="10">&nbsp;</td>';
+		print '<td class="tdlineupdown" nowrap="nowrap">&nbsp;</td>'; // No width to allow autodim
 		print "</tr>\n";
 	}
 
diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php
index 0fc1e047b5a..b556e80402e 100644
--- a/htdocs/core/tpl/ajaxrow.tpl.php
+++ b/htdocs/core/tpl/ajaxrow.tpl.php
@@ -34,11 +34,11 @@ jQuery(document).ready(function(){
         },
         dragHandle: "tdlineupdown"
 	});
-	 jQuery("#objectline tr").hover(function() {
-		 jQuery(this.cells[8]).addClass("showDragHandle");
-   }, function() {
-	   jQuery(this.cells[8]).removeClass("showDragHandle");
-   });
+    jQuery(".tdlineupdown").hover(function() {
+  	     jQuery(this).addClass('showDragHandle');
+    }, function() {
+    	  jQuery(this).removeClass('showDragHandle');
+    });
 });
 </script>
 
diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php
index c479ef63e11..8f73872837c 100644
--- a/htdocs/theme/auguria/style.css.php
+++ b/htdocs/theme/auguria/style.css.php
@@ -151,8 +151,18 @@ form {
     padding: 0em 0em 0em 0em;
     margin: 0em 0em 0em 0em;
 }
-.showDragHandle {
-	cursor: move;
+
+.dragClass {
+    background: #b3c5cc;
+}
+td.showDragHandle {
+    background-image: url(<?php echo DOL_URL_ROOT.'/theme/eldy/img/1updownarrow.png'; ?>);
+    background-repeat: no-repeat;
+    background-position: center center;
+    cursor: move;
+}
+.tdlineupdown {
+    white-space: nowrap;
 }
 
 
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index a637f57119d..8c3a6340ff5 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -158,13 +158,16 @@ form {
 .dragClass {
 	background: #b3c5cc;
 }
-
 td.showDragHandle {
 	background-image: url(<?php echo DOL_URL_ROOT.'/theme/eldy/img/1updownarrow.png'; ?>);
 	background-repeat: no-repeat;
 	background-position: center center;
 	cursor: move;
 }
+.tdlineupdown {
+    white-space: nowrap;
+}
+
 
 /* ============================================================================== */
 /* Styles de positionnement des zones                                             */
diff --git a/htdocs/theme/freelug/style.css.php b/htdocs/theme/freelug/style.css.php
index 2dd09391b0a..dc1fb79f2d0 100644
--- a/htdocs/theme/freelug/style.css.php
+++ b/htdocs/theme/freelug/style.css.php
@@ -153,8 +153,18 @@ form
     padding: 0px 0px 0px 0px;
     margin: 0px 0px 0px 0px;
 }
-.showDragHandle {
-	cursor: move;
+
+.dragClass {
+    background: #b3c5cc;
+}
+td.showDragHandle {
+    background-image: url(<?php echo DOL_URL_ROOT.'/theme/eldy/img/1updownarrow.png'; ?>);
+    background-repeat: no-repeat;
+    background-position: center center;
+    cursor: move;
+}
+.tdlineupdown {
+    white-space: nowrap;
 }
 
 
diff --git a/htdocs/theme/yellow/style.css.php b/htdocs/theme/yellow/style.css.php
index cc8c628f2b0..b61e4ffa981 100644
--- a/htdocs/theme/yellow/style.css.php
+++ b/htdocs/theme/yellow/style.css.php
@@ -141,9 +141,20 @@ form
     padding: 0em 0em 0em 0em;
     margin: 0em 0em 0em 0em;
 }
-.showDragHandle {
-	cursor: move;
+
+.dragClass {
+    background: #b3c5cc;
+}
+td.showDragHandle {
+    background-image: url(<?php echo DOL_URL_ROOT.'/theme/eldy/img/1updownarrow.png'; ?>);
+    background-repeat: no-repeat;
+    background-position: center center;
+    cursor: move;
 }
+.tdlineupdown {
+    white-space: nowrap;
+}
+
 
 
 /* ============================================================================== */
-- 
GitLab