3 * Copyright(c) 2006-2010 Ext JS, LLC
5 * http://www.extjs.com/license
10 Ext.apply(Ext.Element.prototype, function() {
\r
11 var GETDOM = Ext.getDom,
\r
17 * Inserts (or creates) the passed element (or DomHelper config) as a sibling of this element
\r
18 * @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.
\r
19 * @param {String} where (optional) 'before' or 'after' defaults to before
\r
20 * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element
\r
21 * @return {Ext.Element} The inserted Element. If an array is passed, the last inserted element is returned.
\r
23 insertSibling: function(el, where, returnDom){
\r
26 isAfter = (where || 'before').toLowerCase() == 'after',
\r
29 if(Ext.isArray(el)){
\r
31 Ext.each(el, function(e) {
\r
32 rt = Ext.fly(insertEl, '_internal').insertSibling(e, where, returnDom);
\r
42 if(el.nodeType || el.dom){
\r
43 rt = me.dom.parentNode.insertBefore(GETDOM(el), isAfter ? me.dom.nextSibling : me.dom);
\r
48 if (isAfter && !me.dom.nextSibling) {
\r
49 rt = DH.append(me.dom.parentNode, el, !returnDom);
\r
51 rt = DH[isAfter ? 'insertAfter' : 'insertBefore'](me.dom, el, !returnDom);
\r