src/aria/templates/Section.js
function (targetSection) {
                var content = this._content;
                this.$assert(805, this.idMap == null);
                this.$assert(806, content);
                var targetContent = targetSection._content;
                var targetLength = targetContent.length;
                // first move all children from this to target _content array
                // updating the parent reference for sections
                for (var i = 0, l = content.length; i < l; i++) {
                    var item = content[i];
                    targetContent[targetLength + i] = item;
                    if (item._type == TYPE_SECTION) {
                        item.parent = targetSection;
                    }
                }
                // then register content in the target idMap
                this.__updateIdMap(targetSection.idMap);

                // move the {on...} statement callbacks:
                targetSection.delegateIds = targetSection.delegateIds.concat(this.delegateIds);
                targetSection.delegateCallbacks = targetSection.delegateCallbacks.concat(this.delegateCallbacks);
                this.delegateIds = [];
                this.delegateCallbacks = [];

                // and initialize widgets
                var res = null;
                if (targetSection._initWidgetsDone) {
                    res = this.initWidgets();
                }
                // set back idMap to null (may have been changed by __updateIdMap)
                this.idMap = null;
                // this section becomes empty:
                this._content = [];

                return res;
            }
function (targetSection) {
                var content = this._content;
                this.$assert(805, this.idMap == null);
                this.$assert(806, content);
                var targetContent = targetSection._content;
                var targetLength = targetContent.length;
                // first move all children from this to target _content array
                // updating the parent reference for sections
                for (var i = 0, l = content.length; i < l; i++) {
                    var item = content[i];
                    targetContent[targetLength + i] = item;
                    if (item._type == TYPE_SECTION) {
                        item.parent = targetSection;
                    }
                }
                // then register content in the target idMap
                this.__updateIdMap(targetSection.idMap);

                // move the {on...} statement callbacks:
                targetSection.delegateIds = targetSection.delegateIds.concat(this.delegateIds);
                targetSection.delegateCallbacks = targetSection.delegateCallbacks.concat(this.delegateCallbacks);
                this.delegateIds = [];
                this.delegateCallbacks = [];

                // and initialize widgets
                var res = null;
                if (targetSection._initWidgetsDone) {
                    res = this.initWidgets();
                }
                // set back idMap to null (may have been changed by __updateIdMap)
                this.idMap = null;
                // this section becomes empty:
                this._content = [];

                return res;
            }
function ( targetSection ) { var content = this . _content ; this . $assert ( 805 , this . idMap == null ) ; this . $assert ( 806 , content ) ; var targetContent = targetSection . _content ; var targetLength = targetContent . length ; // first move all children from this to target _content array // updating the parent reference for sections for ( var i = 0 , l = content . length ; i < l ; i ++ ) { var item = content [ i ] ; targetContent [ targetLength + i ] = item ; if ( item . _type == TYPE_SECTION ) { item . parent = targetSection ; } } // then register content in the target idMap this . __updateIdMap ( targetSection . idMap ) ; // move the {on...} statement callbacks: targetSection . delegateIds = targetSection . delegateIds . concat ( this . delegateIds ) ; targetSection . delegateCallbacks = targetSection . delegateCallbacks . concat ( this . delegateCallbacks ) ; this . delegateIds = [ ] ; this . delegateCallbacks = [ ] ; // and initialize widgets var res = null ; if ( targetSection . _initWidgetsDone ) { res = this . initWidgets ( ) ; } // set back idMap to null (may have been changed by __updateIdMap) this . idMap = null ; // this section becomes empty: this . _content = [ ] ; return res ; }
Move the content of this section to another section, and initialize section widgets if widgets are
already initialized in the target section. Note that this method should only be used on sections with no
idMap.
@param {aria.templates.Section} targetSection
@return {Array} List of element that will be rendered later on
Move the content of this section to another section and initialize section widgets if widgets are already initialized in the target section . Note that this method should only be used on sections with no idMap .