From 690054c5d33cb959076ca797e22e29f63c74e97e Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sat, 28 Aug 2010 16:12:00 -0600 Subject: [PATCH] Do IE6 check in browser --- framework/Core/lib/Horde/Core/Tree/Javascript.php | 2 -- horde/js/hordetree.js | 32 ++++++++++------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/framework/Core/lib/Horde/Core/Tree/Javascript.php b/framework/Core/lib/Horde/Core/Tree/Javascript.php index eca7f4622..e02757b7d 100644 --- a/framework/Core/lib/Horde/Core/Tree/Javascript.php +++ b/framework/Core/lib/Horde/Core/Tree/Javascript.php @@ -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'], diff --git a/horde/js/hordetree.js b/horde/js/hordetree.js index d274cd31e..53de09204 100644 --- a/horde/js/hordetree.js +++ b/horde/js/hordetree.js @@ -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(), -- 2.11.0