Ticket #5067: 5067-patch.4.diff
File 5067-patch.4.diff, 1.6 KB (added by , 17 years ago) |
---|
-
django/contrib/admin/media/js/core.js
1 1 // Core javascript helper functions 2 2 3 // basic browser identification & version 4 var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion); 5 var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); 6 3 7 // Cross-browser event handlers. 4 8 function addEvent(obj, evType, fn) { 5 9 if (obj.addEventListener) { … … 71 75 var curleft = 0; 72 76 if (obj.offsetParent) { 73 77 while (obj.offsetParent) { 74 curleft += obj.offsetLeft ;78 curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); 75 79 obj = obj.offsetParent; 76 80 } 81 // IE offsetParent does not include the top-level 82 if (isIE && obj.parentElement){ 83 curleft += obj.offsetLeft - obj.scrollLeft; 84 } 77 85 } else if (obj.x) { 78 86 curleft += obj.x; 79 87 } … … 84 92 var curtop = 0; 85 93 if (obj.offsetParent) { 86 94 while (obj.offsetParent) { 87 curtop += obj.offsetTop ;95 curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); 88 96 obj = obj.offsetParent; 89 97 } 98 // IE offsetParent does not include the top-level 99 if (isIE && obj.parentElement){ 100 curtop += obj.offsetTop - obj.scrollTop; 101 } 90 102 } else if (obj.y) { 91 103 curtop += obj.y; 92 104 }