dist/index-es.js
function unnest($columns) {
        const queue = [];
        let $node;

        // Push the root unordered list item into the queue.
        queue.push($columns.children());

        while (queue.length) {
            $node = queue.shift();

            $node.children(itemSelector).each(function (item, el) {
                const $this = $(this);
                const $child = $this.children(columnSelector),
                      $ancestor = $this.parent().parent();

                // Retain item hierarchy (because it is lost after flattening).
                if ($ancestor.length && $this.data(`${namespace}-ancestor`) == null) {
                    // Use addBack to reset all selection chains.
                    $(this).siblings().addBack().data(`${namespace}-ancestor`, $ancestor);
                }

                if ($child.length) {
                    queue.push($child);
                    $(this).data(`${namespace}-child`, $child).addClass(`${namespace}-parent`);
                }

                // Causes item siblings to have a flattened DOM lineage.
                $(this).parent(columnSelector).appendTo($columns).addClass(`${namespace}-column`);
            });
        }
    }
function unnest($columns) {
        const queue = [];
        let $node;

        // Push the root unordered list item into the queue.
        queue.push($columns.children());

        while (queue.length) {
            $node = queue.shift();

            $node.children(itemSelector).each(function (item, el) {
                const $this = $(this);
                const $child = $this.children(columnSelector),
                      $ancestor = $this.parent().parent();

                // Retain item hierarchy (because it is lost after flattening).
                if ($ancestor.length && $this.data(`${namespace}-ancestor`) == null) {
                    // Use addBack to reset all selection chains.
                    $(this).siblings().addBack().data(`${namespace}-ancestor`, $ancestor);
                }

                if ($child.length) {
                    queue.push($child);
                    $(this).data(`${namespace}-child`, $child).addClass(`${namespace}-parent`);
                }

                // Causes item siblings to have a flattened DOM lineage.
                $(this).parent(columnSelector).appendTo($columns).addClass(`${namespace}-column`);
            });
        }
    }
function unnest ( $columns ) { const queue = [ ] ; let $node ; // Push the root unordered list item into the queue. queue . push ( $columns . children ( ) ) ; while ( queue . length ) { $node = queue . shift ( ) ; $node . children ( itemSelector ) . each ( function ( item , el ) { const $this = $ ( this ) ; const $child = $this . children ( columnSelector ) , $ancestor = $this . parent ( ) . parent ( ) ; // Retain item hierarchy (because it is lost after flattening). if ( $ancestor . length && $this . data ( ` ${ namespace } ` ) == null ) { // Use addBack to reset all selection chains. $ ( this ) . siblings ( ) . addBack ( ) . data ( ` ${ namespace } ` , $ancestor ) ; } if ( $child . length ) { queue . push ( $child ) ; $ ( this ) . data ( ` ${ namespace } ` , $child ) . addClass ( ` ${ namespace } ` ) ; } // Causes item siblings to have a flattened DOM lineage. $ ( this ) . parent ( columnSelector ) . appendTo ( $columns ) . addClass ( ` ${ namespace } ` ) ; } ) ; } }
Convert nested lists into columns using breadth-first traversal.
Convert nested lists into columns using breadth - first traversal .