3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.1
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
18 Ext.apply(Ext.Element.prototype, function() {
19 var GETDOM = Ext.getDom,
24 <div id="method-Ext.Element-insertSibling"></div>/**
25 * Inserts (or creates) the passed element (or DomHelper config) as a sibling of this element
26 * @param {Mixed/Object/Array} el The id, element to insert or a DomHelper config to create and insert *or* an array of any of those.
27 * @param {String} where (optional) 'before' or 'after' defaults to before
28 * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element
29 * @return {Ext.Element} The inserted Element. If an array is passed, the last inserted element is returned.
31 insertSibling: function(el, where, returnDom){
34 isAfter = (where || 'before').toLowerCase() == 'after',
39 Ext.each(el, function(e) {
40 rt = Ext.fly(insertEl, '_internal').insertSibling(e, where, returnDom);
50 if(el.nodeType || el.dom){
51 rt = me.dom.parentNode.insertBefore(GETDOM(el), isAfter ? me.dom.nextSibling : me.dom);
56 if (isAfter && !me.dom.nextSibling) {
57 rt = DH.append(me.dom.parentNode, el, !returnDom);
59 rt = DH[isAfter ? 'insertAfter' : 'insertBefore'](me.dom, el, !returnDom);