PDA

View Full Version : [FIXED][3.0] Element.insertion.js replaceWith



stever
7 Apr 2009, 2:40 PM
El is not defined. It means to use Element in the line: "delete El.cache[me.id];".

Original:

replaceWith: function(el){
var me = this,
Element = Ext.Element;
if(el.nodeType || el.dom){
el = GETDOM(el);
me.dom.parentNode.insertBefore(el, me.dom);
}else{
el = DH.insertBefore(me.dom, el);
}

delete El.cache[me.id];
Ext.removeNode(me.dom);
me.id = Ext.id(me.dom = el);
return Element.cache[me.id] = me;
}

Proposed:

replaceWith: function(el){
var me = this,
Element = Ext.Element;
if(el.nodeType || el.dom){
el = GETDOM(el);
me.dom.parentNode.insertBefore(el, me.dom);
}else{
el = DH.insertBefore(me.dom, el);
}

delete Element.cache[me.id];
Ext.removeNode(me.dom);
me.id = Ext.id(me.dom = el);
return Element.cache[me.id] = me;
}

evant
7 Apr 2009, 3:05 PM
Fixed.