mirror of
https://github.com/django/django.git
synced 2025-03-31 19:46:42 +00:00
Fixed #5067 -- Fixed a problem with javascript popup widgets appearing in the wrong place if they were in a overflow=scroll block. Thanks to Erich Schmid for the original fix, and Robert Coup for the updated patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
134bf3a26b
commit
3358e2fec7
@ -1,5 +1,9 @@
|
|||||||
// Core javascript helper functions
|
// Core javascript helper functions
|
||||||
|
|
||||||
|
// basic browser identification & version
|
||||||
|
var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion);
|
||||||
|
var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]);
|
||||||
|
|
||||||
// Cross-browser event handlers.
|
// Cross-browser event handlers.
|
||||||
function addEvent(obj, evType, fn) {
|
function addEvent(obj, evType, fn) {
|
||||||
if (obj.addEventListener) {
|
if (obj.addEventListener) {
|
||||||
@ -71,9 +75,13 @@ function findPosX(obj) {
|
|||||||
var curleft = 0;
|
var curleft = 0;
|
||||||
if (obj.offsetParent) {
|
if (obj.offsetParent) {
|
||||||
while (obj.offsetParent) {
|
while (obj.offsetParent) {
|
||||||
curleft += obj.offsetLeft;
|
curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft);
|
||||||
obj = obj.offsetParent;
|
obj = obj.offsetParent;
|
||||||
}
|
}
|
||||||
|
// IE offsetParent does not include the top-level
|
||||||
|
if (isIE && obj.parentElement){
|
||||||
|
curleft += obj.offsetLeft - obj.scrollLeft;
|
||||||
|
}
|
||||||
} else if (obj.x) {
|
} else if (obj.x) {
|
||||||
curleft += obj.x;
|
curleft += obj.x;
|
||||||
}
|
}
|
||||||
@ -84,9 +92,13 @@ function findPosY(obj) {
|
|||||||
var curtop = 0;
|
var curtop = 0;
|
||||||
if (obj.offsetParent) {
|
if (obj.offsetParent) {
|
||||||
while (obj.offsetParent) {
|
while (obj.offsetParent) {
|
||||||
curtop += obj.offsetTop;
|
curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop);
|
||||||
obj = obj.offsetParent;
|
obj = obj.offsetParent;
|
||||||
}
|
}
|
||||||
|
// IE offsetParent does not include the top-level
|
||||||
|
if (isIE && obj.parentElement){
|
||||||
|
curtop += obj.offsetTop - obj.scrollTop;
|
||||||
|
}
|
||||||
} else if (obj.y) {
|
} else if (obj.y) {
|
||||||
curtop += obj.y;
|
curtop += obj.y;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user