Code

Fixed sorter display without scroll bar
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Jan 2010 16:41:38 +0000 (16:41 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Jan 2010 16:41:38 +0000 (16:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15211 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/themes/default/style.css
gosa-core/include/class_sortableListing.inc

index c9e2ccb504982ce8aa795624f1f4a2d9b546c9af..b92a7309aa328da38c62230aa5f3e782459a83ed 100644 (file)
@@ -1927,6 +1927,7 @@ td.nlistFooter {
 div.sortableListContainer {
     border: 1px solid #AAA;
     overflow: auto;
+    background-color: white;
 }
 
 .sortableListContainer th{
@@ -1945,6 +1946,12 @@ div.sortableListContainer {
 tr.sortableListItem {
     background-color: white;
     cursor:move;
+    color: black;
+}
+
+tr.sortableListItemFill {
+    background-color: white;
+    cursor:default;
 }
 
 tr.sortableListItemOdd ::-moz-selection, tr.sortableListItem ::-moz-selection{
@@ -1967,6 +1974,7 @@ tr.sortableListItemOdd code::selection, tr.sortableListItem code::selection {
 tr.sortableListItemOdd {
     background-color: #F5F5F5;
     cursor:move;
+    color: black;
 }
 tr.sortableListItem:hover, tr.sortableListItemOdd:hover {
     background-color: #EEE;
index 24aa956b0f670f5a1c39252a72d1a9dcf797d7df..6c8e65647619dc9c3cd6472bbd879a21ae3c43d5 100644 (file)
@@ -58,10 +58,10 @@ class sortableListing {
       foreach ($data as $value) {
         $displayData[]= array($value);
       }
-    } else {
-      $this->setDisplayData($displayData);
     }
 
+    $this->setDisplayData($displayData);
+
     // Generate instance wide unique ID
     $tmp= gettimeofday();
     $this->id= 'l'.md5($tmp['sec']);
@@ -160,7 +160,7 @@ class sortableListing {
   public function render()
   {
     $result= "<div class='sortableListContainer' id='scroll_".$this->id."' style='width: ".$this->width."; height: ".$this->height."'>\n";
-    $result.= "<table border='0' cellpadding='0' cellspacing='0' width='100%' height='100%' style='position: relative;'".(!empty($this->cssclass)?" class='".$this->cssclass."'":"").">\n";
+    $result.= "<table border='0' cellpadding='0' cellspacing='0' height='100%' width='100%' style='table-layout:fixed; position: relative;'".(!empty($this->cssclass)?" class='".$this->cssclass."'":"").">\n";
     $action_width= 0;
     if (strpos($this->acl, 'w') === false) {
       $edit_image= $this->editable?"<img class='center' src='images/lists/edit-grey.png' alt='"._("Edit")."'>":"";
@@ -217,8 +217,10 @@ class sortableListing {
       foreach ($this->mapping as $nr => $row) {
         $editable= $this->editable?" onclick='$(\"edit_".$this->id."_$nr\").click()'":"";
         $result.= "  <tr class='sortableListItem".($nr&1?'Odd':'')."' id='item_".$this->id."_$nr'$reorderable>\n";
+        $first= " style='border:0'";
         foreach ($this->displayData[$row] as $column) {
-          $result.= "   <td$editable>".htmlentities($column)."</td>\n";
+          $result.= "   <td$editable$first>".htmlentities($column)."</td>\n";
+          $first= "";
         }
         if ($action_width) {
           $result.= "<td>".str_replace('%ID', "edit_".$this->id."_$nr", $edit_image).
@@ -226,10 +228,16 @@ class sortableListing {
         }
         $result.= "  </tr>\n";
       }
-    } else {
-      $result.= "  <tr class='sortableListItem' style='height:100%'></tr>\n";
     }
 
+    // Add spacer
+    $result.= "  <tr class='sortableListItemFill' style='height:100%'><td style='border:0'></td>";
+    $num= $action_width?$this->columns:$this->columns-1;
+    for ($i= 0; $i<$num; $i++) {
+      $result.= "<td class='sortableListItemFill'></td>";
+    }
+    $result.= "</tr>\n";
+
     $result.= " </tbody>\n</table>\n</div>\n";
     $result.= " <input type='hidden' name='PID' value='".$this->id."' id='PID'>\n";
     $result.= " <input type='hidden' name='position_".$this->id."' id='position_".$this->id."'>\n";