EXTがエラーを示していない---ソリューションバックアップ
3179 ワード
未知のエラーバックアップのソースコードの変更にtry catchを追加
(function(){
var libFlyweight;
function fly(el) {
if (!libFlyweight) {
libFlyweight = new Ext.Element.Flyweight();
}
libFlyweight.dom = el;
return libFlyweight;
}
Ext.lib.Dom.getXY = function(el) {
var p, pe, b, scroll, bd = (document.body || document.documentElement);
el = Ext.getDom(el);
if(el == bd){
return [0, 0];
}
if (el.getBoundingClientRect) {
try{ // LB's code
b = el.getBoundingClientRect();
}catch(ex){
return [0,0];
}
scroll = fly(document).getScroll();
return [b.left + scroll.left, b.top + scroll.top];
}
var x = 0, y = 0;
p = el;
var hasAbsolute = fly(el).getStyle("position") == "absolute";
while (p) {
x += p.offsetLeft;
y += p.offsetTop;
if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
hasAbsolute = true;
}
if (Ext.isGecko) {
pe = fly(p);
var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
x += bl;
y += bt;
if (p != el && pe.getStyle('overflow') != 'visible') {
x += bl;
y += bt;
}
}
p = p.offsetParent;
}
if (Ext.isSafari && hasAbsolute) {
x -= bd.offsetLeft;
y -= bd.offsetTop;
}
if (Ext.isGecko && !hasAbsolute) {
var dbd = fly(bd);
x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
}
p = el.parentNode;
while (p && p != bd) {
if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {
x -= p.scrollLeft;
y -= p.scrollTop;
}
p = p.parentNode;
}
return [x, y];
}})();