X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/Element.insertion.html diff --git a/docs/source/Element.insertion.html b/docs/source/Element.insertion.html index a5744f3e..eac4a9e3 100644 --- a/docs/source/Element.insertion.html +++ b/docs/source/Element.insertion.html @@ -1,5 +1,6 @@ + The source code @@ -12,10 +13,7 @@ Ext.Element.addMethods( function() { var GETDOM = Ext.getDom, GET = Ext.get, - DH = Ext.DomHelper, - isEl = function(el){ - return (el.nodeType || el.dom || typeof el == 'string'); - }; + DH = Ext.DomHelper; return {
/** @@ -64,14 +62,14 @@ function() { */ insertFirst: function(el, returnDom){ el = el || {}; - if(isEl(el)){ // element + if(el.nodeType || el.dom || typeof el == 'string'){ // element el = GETDOM(el); this.dom.insertBefore(el, this.dom.firstChild); return !returnDom ? GET(el) : el; }else{ // dh config return this.createChild(el, this.dom.firstChild, returnDom); } - }, + },
/** * Replaces the passed element with this element @@ -91,19 +89,20 @@ function() { * @return {Ext.Element} this */ replaceWith: function(el){ - var me = this, - Element = Ext.Element; - if(isEl(el)){ + var me = this; + + if(el.nodeType || el.dom || typeof el == 'string'){ el = GETDOM(el); me.dom.parentNode.insertBefore(el, me.dom); }else{ el = DH.insertBefore(me.dom, el); } - delete Element.cache[me.id]; + delete Ext.elCache[me.id]; Ext.removeNode(me.dom); me.id = Ext.id(me.dom = el); - return Element.cache[me.id] = me; + Ext.Element.addToCache(me.isFlyweight ? new Ext.Element(me.dom) : me); + return me; },
/**