Django

Code

Changeset 6172

Show
Ignore:
Timestamp:
09/14/07 01:43:46 (1 year ago)
Author:
russellm
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/admin/media/js/core.js

    r4087 r6172  
    11// Core javascript helper functions 
     2 
     3// basic browser identification & version 
     4var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion); 
     5var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); 
    26 
    37// Cross-browser event handlers. 
     
    7276    if (obj.offsetParent) { 
    7377        while (obj.offsetParent) { 
    74             curleft += obj.offsetLeft
     78            curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft)
    7579            obj = obj.offsetParent; 
     80        } 
     81        // IE offsetParent does not include the top-level  
     82        if (isIE && obj.parentElement){ 
     83            curleft += obj.offsetLeft - obj.scrollLeft; 
    7684        } 
    7785    } else if (obj.x) { 
     
    8593    if (obj.offsetParent) { 
    8694        while (obj.offsetParent) { 
    87             curtop += obj.offsetTop
     95            curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop)
    8896            obj = obj.offsetParent; 
     97        } 
     98        // IE offsetParent does not include the top-level  
     99        if (isIE && obj.parentElement){ 
     100            curtop += obj.offsetTop - obj.scrollTop; 
    89101        } 
    90102    } else if (obj.y) {