From: x2001corpet Date: Sat, 30 Sep 2006 09:24:31 +0000 (+0000) Subject: backport fix signaler un bug sur IE X-Git-Tag: xorg/0.9.12~236 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=c3f52cc3e17e72cc2e227f0d638a8d05a162e635;p=platal.git backport fix signaler un bug sur IE git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@930 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/htdocs/javascript/flyspray.js b/htdocs/javascript/flyspray.js index 337e0aa..3cd41d1 100644 --- a/htdocs/javascript/flyspray.js +++ b/htdocs/javascript/flyspray.js @@ -19,10 +19,41 @@ ***************************************************************************/ function send_bug() { + var h = windowHeight(); + var y = getScrollY(); + y += (h - 470) /2; document.getElementById('flyspray_report').style.display = 'block'; + document.getElementById('flyspray_report').style.top = y+'px'; return false; } +function getScrollY() { + var scrOfX = 0, scrOfY = 0; + if( typeof( window.pageYOffset ) == 'number' ) { + //Netscape compliant + scrOfY = window.pageYOffset; + } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { + //DOM compliant + scrOfY = document.body.scrollTop; + } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { + //IE6 standards compliant mode + scrOfY = document.documentElement.scrollTop; + } + return scrOfY; +} +function windowHeight() { + if( typeof( window.innerWidth ) == 'number' ) { + //Non-IE + return window.innerHeight; + } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { + return document.documentElement.clientHeight; + } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { + //IE 4 compatible + return document.body.clientHeight; + } + return 0; +} + function close_bug(f,send) { var detail = document.getElementById('flyspray_detail'); detail.value = utf8(detail.value); diff --git a/templates/skin/common.bug.tpl b/templates/skin/common.bug.tpl index 503a191..5a1c911 100644 --- a/templates/skin/common.bug.tpl +++ b/templates/skin/common.bug.tpl @@ -1,6 +1,6 @@ -