[Phpfreechat-svn] SF.net SVN: phpfreechat: [1128] trunk/data/public/js/pfcprompt.js
Status: Beta
Brought to you by:
kerphi
From: <gpi...@us...> - 2007-08-16 23:40:20
|
Revision: 1128 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1128&view=rev Author: gpinzone Date: 2007-08-16 16:40:18 -0700 (Thu, 16 Aug 2007) Log Message: ----------- Allow blackout of chat area on IE7. IE6 and lower still does whole screen. Blackout height/width fixed for IE 5.5. Modified Paths: -------------- trunk/data/public/js/pfcprompt.js Modified: trunk/data/public/js/pfcprompt.js =================================================================== --- trunk/data/public/js/pfcprompt.js 2007-08-16 17:46:48 UTC (rev 1127) +++ trunk/data/public/js/pfcprompt.js 2007-08-16 23:40:18 UTC (rev 1128) @@ -5,7 +5,7 @@ pfcPrompt.prototype = { initialize: function(container) { - if (container == undefined || is_ie) + if (container == undefined || (is_ie && !is_ie7)) container = document.getElementsByTagName('body')[0]; this.container = container; this.box = $('pfc_promptbox'); @@ -102,8 +102,18 @@ var pos = this._findPos(this.container); this.bgbox.style.top = pos[1]+'px'; this.bgbox.style.left = pos[0]+'px'; - this.bgbox.style.height = this.container.offsetHeight+'px'; - this.bgbox.style.width = this.container.offsetWidth+'px'; + /* Some older IE browsers (e.g., IE 5.5) need scrollHeight/scrollWidth. + See: http://www.quirksmode.org/viewport/compatibility.html */ + if (this.container.scrollHeight > this.container.offsetHeight) + { + this.bgbox.style.height = this.container.scrollHeight+'px'; + this.bgbox.style.width = this.container.scrollWidth+'px'; + } + else + { + this.bgbox.style.height = this.container.offsetHeight+'px'; + this.bgbox.style.width = this.container.offsetWidth+'px'; + } this.bgbox.style.display = 'block'; // Position the dialog box on the screen and make it visible. @@ -132,13 +142,13 @@ _findPos: function(obj) { - var curleft = curtop = 0; + var curleft = curtop = 0; if (obj.offsetParent) { - curleft = obj.offsetLeft; - curtop = obj.offsetTop; - while (obj = obj.offsetParent) { + curleft = obj.offsetLeft; + curtop = obj.offsetTop; + while (obj = obj.offsetParent) { curleft += obj.offsetLeft; - curtop += obj.offsetTop; + curtop += obj.offsetTop; } } return [curleft,curtop]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |