Code

Ported ogroups to new listing.
[gosa.git] / gosa-core / html / include / focus.js
index 843a0a123b419fbb006becf2c5b919a505368ab6..6ade45d20b410747c990c79de7a3296855b52a40 100644 (file)
@@ -256,7 +256,7 @@ function show(element) {
   document.poppedLayer.style.visibility = "visible";
 }
 
-function toggle(element) {
+function GOsa_toggle(element) {
   if (browserType == "gecko" )
      document.poppedLayer = document.getElementById(element);
   else if (browserType == "ie")
@@ -286,7 +286,7 @@ function js_check(form) {
        form.javascript.value = 'true';
 }
 
-function divtoggle(element) {
+function divGOsa_toggle(element) {
        var cell;
        var cellname="tr_"+(element);
 
@@ -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,20 +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')) {
+                  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";