Code

Updated js
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Nov 2007 07:26:36 +0000 (07:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Nov 2007 07:26:36 +0000 (07:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-playground@7762 594d385d-05f5-0310-b6e9-bd551577e9d8

ListTest/ObjectListViewport.js
include/class_ObjectListViewport.inc

index 51a96209118efc2f207c4f259b1e6013063b8b20..9df1d33cc3dadc62b852fba71d49017f95dc3895 100644 (file)
@@ -13,7 +13,7 @@ window.onresize = updateObjectListViewportSize;
                var viewport_w  = 0;
                var all                 = new Array();
                var i                   = 0;
-               var id_pref             = "";
+               var list_id             = "";
                var calc                = 0;
        
         /* Somehow IE do not need to be resized
@@ -30,44 +30,44 @@ window.onresize = updateObjectListViewportSize;
         all = getElementsByStyleClass('ObjectListViewport');
         for (i = 0; i < all.length; ++i){
 
-            id_pref = all[i].id.replace(/[^0-9]*/,"");
+            list_id = all[i].id.replace(/[^0-9]*/,"");
 
             /* Set Viewport to min height, to ensure
              *  that resize will work correctly in konqueror
              */
-            document.getElementById('ObjectListViewport_Entry_Cover' + id_pref).style.height= "50px";
+            document.getElementById('ObjectListViewport_Entry_Cover' + list_id).style.height= "50px";
 
             /* Get values of displayed header and footer heights to be
              *  able to recalculate the Viewport
              */
-            viewport    = getObjectHeight('ObjectListViewport_Table' + id_pref);
+            viewport    = getObjectHeight('ObjectListViewport_Table' + list_id);
 
                        /* Get Header height for ViewPort height calculation */
-                       if(document.getElementById('ObjectListViewport_TD_Header' + id_pref)){
-               header = getObjectHeight('ObjectListViewport_TD_Header' + id_pref);
+                       if(document.getElementById('ObjectListViewport_TD_Header' + list_id)){
+               header = getObjectHeight('ObjectListViewport_TD_Header' + list_id);
                        }else{
                                header =0;
                        }
                
                        /* Get Footer height for ViewPort height calculation */
-                       if(document.getElementById('ObjectListViewport_TD_Footer' + id_pref)){
-               footer = getObjectHeight('ObjectListViewport_TD_Footer' + id_pref);
+                       if(document.getElementById('ObjectListViewport_TD_Footer' + list_id)){
+               footer = getObjectHeight('ObjectListViewport_TD_Footer' + list_id);
                        }else{
                                footer = 0
                        }
 
             /* Calculate the new visible entry part height. */
             calc = (viewport  - ( header + footer ));
-            document.getElementById('ObjectListViewport_Entry_Cover' + id_pref).style.height = calc;
+            document.getElementById('ObjectListViewport_Entry_Cover' + list_id).style.height = calc;
 
             /* Reduce width of entry list, we need some space to
              *  display the scrollbar without breaking the layout
                         * Only required if a header is shown.
              */
-                       if(document.getElementById('ObjectListViewport_TD_Header' + id_pref)){
-                               viewport_w = getObjectWidth('ObjectListViewport_Table' + id_pref);
-                               document.getElementById('ObjectListViewport_Entry_Table' + id_pref).style.width = (viewport_w - 18) + 'px';
-                               document.getElementById('ObjectListViewport_Header_Table' + id_pref).style.width = (viewport_w - 18) + 'px';
+                       if(document.getElementById('ObjectListViewport_TD_Header' + list_id)){
+                               viewport_w = getObjectWidth('ObjectListViewport_Table' + list_id);
+                               document.getElementById('ObjectListViewport_Entry_Table' + list_id).style.width = (viewport_w - 18) + 'px';
+                               document.getElementById('ObjectListViewport_Header_Table' + list_id).style.width = (viewport_w - 18) + 'px';
                        }
         }
     }
index d7386fd12fb8d1eb41ca27d7273220c970790801..3ec96e99538c13fc62179b7a0e776ea28d2db68d 100644 (file)
@@ -195,13 +195,14 @@ class ObjectListViewport {
       }
     }
 
+    /* Add class depending on given id, to alternate background colors */
     if($this->colorAlternator++ & 1){
       $a = "class='ObjectListViewport_Entry_Row1'";
     }else{
       $a = "class='ObjectListViewport_Entry_Row2'";
     }
 
-    return "<tr ".$a.">".$buffer."</tr>\n";
+    return "<tr ".$a.">\n".$buffer."</tr>\n";
   }