From: cajus Date: Tue, 19 Jan 2010 12:30:21 +0000 (+0000) Subject: Fix a couple of js errors X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ab78ed3679bbc4bd83f46031fe2d2b2783bfbb89;p=gosa.git Fix a couple of js errors git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15199 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/html/include/events.js b/gosa-core/html/include/events.js index 612f262a3..3b893d239 100644 --- a/gosa-core/html/include/events.js +++ b/gosa-core/html/include/events.js @@ -18,5 +18,7 @@ function OnLoad() function OnResize() { adjust(); - resizeHandler(); + if(document['resizeHandler']) { + resizeHandler(); + } } diff --git a/gosa-core/html/include/focus.js b/gosa-core/html/include/focus.js index ba5f23ab9..4222a9f65 100644 --- a/gosa-core/html/include/focus.js +++ b/gosa-core/html/include/focus.js @@ -421,16 +421,24 @@ function adjust_width(e) 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"; + if (document.getElementById('t_scrollbody') != null) { + 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"; + if (document.getElementById('t_scrollhead') != null) { + 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"; + if (document.getElementById('t_scrollbody') != null) { + 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"; + if (document.getElementById('t_scrollhead') != null) { + document.getElementById('t_scrollhead').style.width=div_width+"px"; + } } // window has been downscaled, we must reset the div to 600px @@ -438,10 +446,14 @@ function adjust_width(e) // Reset layout (set width to 600px) div_width=space; document.getElementById('d_scrollbody').style.width=div_width+"px"; - document.getElementById('t_scrollbody').style.width=(div_width-19)+"px"; + if (document.getElementById('t_scrollbody') != null) { + 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"; + if (document.getElementById('t_scrollhead') != null) { + document.getElementById('t_scrollhead').style.width=div_width+"px"; + } } } else if(document.defaultView && document.getElementById("t_scrolltable_onlywidth")){ // Resize the div