3 * Copyright(c) 2006-2009 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
\r
23 insertSibling: function(el, where, returnDom){
\r
27 if(Ext.isArray(el)){
\r
28 Ext.each(el, function(e) {
\r
29 rt = me.insertSibling(e, where, returnDom);
\r
34 where = (where || 'before').toLowerCase();
\r
37 if(el.nodeType || el.dom){
\r
38 rt = me.dom.parentNode.insertBefore(GETDOM(el), where == 'before' ? me.dom : me.dom.nextSibling);
\r
43 if (where == 'after' && !me.dom.nextSibling) {
\r
44 rt = DH.append(me.dom.parentNode, el, !returnDom);
\r
46 rt = DH[where == 'after' ? 'insertAfter' : 'insertBefore'](me.dom, el, !returnDom);
\r