Do IE6 check in browser
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 28 Aug 2010 22:12:00 +0000 (16:12 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sat, 28 Aug 2010 22:12:00 +0000 (16:12 -0600)
framework/Core/lib/Horde/Core/Tree/Javascript.php
horde/js/hordetree.js

index eca7f46..e02757b 100644 (file)
@@ -79,8 +79,6 @@ class Horde_Core_Tree_Javascript extends Horde_Core_Tree_Html
             'cookieDomain' => $GLOBALS['conf']['cookie']['domain'],
             'cookiePath' => $GLOBALS['conf']['cookie']['path'],
 
-            'scrollbar_in_way' => $GLOBALS['browser']->hasQuirk('scrollbar_in_way'),
-
             'imgBlank' => $this->_images['blank'],
             'imgFolder' => $this->_images['folder'],
             'imgFolderOpen' => $this->_images['folderopen'],
index d274cd3..53de092 100644 (file)
@@ -35,6 +35,8 @@ var Horde_Tree = Class.create({
         }
 
         $(this.opts.target).observe('click', this._onClick.bindAsEventListener(this));
+
+        this.opts.ie6 = (navigator.userAgent.toLowerCase().substr(25,6)=="msie 6");
     },
 
     renderTree: function(nodes, rootNodes, renderStatic)
@@ -54,7 +56,18 @@ var Horde_Tree = Class.create({
         $(this.opts.target).update('');
         $(this.opts.target).appendChild(this.output);
 
-        this._correctWidthForScrollbar();
+        if (this.opts.ie6) {
+            /* Correct for frame scrollbar in IE6 by determining if a scrollbar
+             * is present, and if not readjusting the marginRight property to
+             * 0. See http://www.xs4all.nl/~ppk/js/doctypes.html for why this
+             * works */
+            if (document.documentElement.clientHeight == document.documentElement.offsetHeight) {
+                // no scrollbar present, take away extra margin
+                $(document.body).setStyle({ marginRight: 0 });
+            } else {
+                $(document.body).setStyle({ marginRight: '15px' });
+            }
+        }
 
         // If using alternating row shading, work out correct shade.
         if (this.opts.options.alternate) {
@@ -477,23 +490,6 @@ var Horde_Tree = Class.create({
     {
         document.cookie = name + '=exp' + escape(value) + ';DOMAIN=' + this.opts.cookieDomain + ';PATH=' + this.opts.cookiePath + ';';
     },
-
-    _correctWidthForScrollbar: function()
-    {
-        if (this.opts.scrollbar_in_way) {
-            /* Correct for frame scrollbar in IE by determining if a scrollbar
-             * is present, and if not readjusting the marginRight property to
-             * 0. See http://www.xs4all.nl/~ppk/js/doctypes.html for why this
-             * works */
-            if (document.documentElement.clientHeight == document.documentElement.offsetHeight) {
-                // no scrollbar present, take away extra margin
-                $(document.body).setStyle({ marginRight: 0 });
-            } else {
-                $(document.body).setStyle({ marginRight: '15px' });
-            }
-        }
-    },
-
     _onClick: function(e)
     {
         var elt = e.element(),