Code

Ported ogroups to new listing.
[gosa.git] / gosa-core / html / include / focus.js
index e78e68fc38ee14e13cd947c0be11835b48dcea1f..6ade45d20b410747c990c79de7a3296855b52a40 100644 (file)
@@ -338,15 +338,20 @@ function adjust_height(e) {
        
                // document.defaultView allows access to the rendered size of elements and should be supported by modern browsers
                if(document.defaultView) {
-                       var menu_height=parseInt(document.defaultView.getComputedStyle(document.getElementById("menucell"),"").getPropertyValue('height'));
-       
-                       // Minimum height for divlist should be the bottom edge of the menu
-                       min_height= menu_height-197;
-                       suggested= min_height;
-                       if((inner_height-230)-suggested>0) {
-                               suggested= inner_height-230;
-                       }
+                        var menu_height= 0;
+                        if (document.getElementById("d_height")){
+                         suggested= parseInt(document.getElementById("d_height").value);
+                        } else {
+                         menu_height=parseInt(document.defaultView.getComputedStyle(document.getElementById("menucell"),"").getPropertyValue('height'));
+                         // Minimum height for divlist should be the bottom edge of the menu
+                         min_height= menu_height-197;
+                         suggested= min_height;
+                         if((inner_height-230)-suggested>0) {
+                               suggested= inner_height-230;
+                         }
                
+                        }
+       
                // IE uses other height specifications
                } else if (browserType == "ie") {
                        suggested= document.all.menucell.offsetHeight;
@@ -390,23 +395,36 @@ function adjust_width(e)
                var width= parseInt(window.innerWidth);
 
                // Resize the body cells, 470 represents the info box and the navigation part 
-               var diff= width -       div_width       -       470;
+                var save= 470;
                 if(document.getElementById('d_save')) {
-                  diff= width - div_width - document.getElementById('d_save').value;
+                  save= document.getElementById('d_save').value;
                 }
-               
+                var space= 600;
+                if(document.getElementById('d_space')) {
+                  space= document.getElementById('d_space').value;
+                }
+               var diff= width - div_width - save;
+
                // window has been upscaled
-               if(div_width+diff>=600) {
-                       document.getElementById('d_scrollbody').style.width=div_width+diff+"px";
-                       document.getElementById('t_scrollbody').style.width=(div_width-19)+diff+"px";
+               if(div_width+diff>=space) {
+                        if (width - save > space) {
+                         document.getElementById('d_scrollbody').style.width=div_width+diff+"px";
+                         document.getElementById('t_scrollbody').style.width=(div_width-19)+diff+"px";
        
-                       // Resize the Header cells (only the relative-width ones)
-                       document.getElementById('t_scrollhead').style.width=div_width+diff+"px";
+                         // Resize the Header cells (only the relative-width ones)
+                         document.getElementById('t_scrollhead').style.width=div_width+diff+"px";
+                        } else {
+                         document.getElementById('d_scrollbody').style.width=div_width+"px";
+                         document.getElementById('t_scrollbody').style.width=(div_width-19)+"px";
+       
+                         // Resize the Header cells (only the relative-width ones)
+                         document.getElementById('t_scrollhead').style.width=div_width+"px";
+                        }
 
                // window has been downscaled, we must reset the div to 600px
-               } else if (width < 930) {
+               } else if (width < 1200) {
                        // Reset layout (set width to 600px)
-                       div_width=600;
+                       div_width=space;
                        document.getElementById('d_scrollbody').style.width=div_width+"px";
                        document.getElementById('t_scrollbody').style.width=(div_width-19)+"px";