<html>\r
<head>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \r
<title>The source code</title>\r
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
function() {\r
var GETDOM = Ext.getDom,\r
GET = Ext.get,\r
- DH = Ext.DomHelper,\r
- isEl = function(el){\r
- return (el.nodeType || el.dom || typeof el == 'string'); \r
- };\r
+ DH = Ext.DomHelper;\r
\r
return {\r
<div id="method-Ext.Element-appendChild"></div>/**\r
*/\r
insertFirst: function(el, returnDom){\r
el = el || {};\r
- if(isEl(el)){ // element\r
+ if(el.nodeType || el.dom || typeof el == 'string'){ // element\r
el = GETDOM(el);\r
this.dom.insertBefore(el, this.dom.firstChild);\r
return !returnDom ? GET(el) : el;\r
}else{ // dh config\r
return this.createChild(el, this.dom.firstChild, returnDom);\r
}\r
- },\r
+ },\r
\r
<div id="method-Ext.Element-replace"></div>/**\r
* Replaces the passed element with this element\r
* @return {Ext.Element} this\r
*/\r
replaceWith: function(el){\r
- var me = this,\r
- Element = Ext.Element;\r
- if(isEl(el)){\r
+ var me = this;\r
+ \r
+ if(el.nodeType || el.dom || typeof el == 'string'){\r
el = GETDOM(el);\r
me.dom.parentNode.insertBefore(el, me.dom);\r
}else{\r
el = DH.insertBefore(me.dom, el);\r
}\r
\r
- delete Element.cache[me.id];\r
+ delete Ext.elCache[me.id];\r
Ext.removeNode(me.dom); \r
me.id = Ext.id(me.dom = el);\r
- return Element.cache[me.id] = me; \r
+ Ext.Element.addToCache(me.isFlyweight ? new Ext.Element(me.dom) : me); \r
+ return me;\r
},\r
\r
<div id="method-Ext.Element-createChild"></div>/**\r