RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/**
 * Collapse all selected blocks, return single HTML elements for each block
 * @param editor The editor instance
 * @param forEachCallback A callback function to invoke for each of the collapsed element
 */
Collapse all selected blocks, return single HTML elements for each block
@param editor The editor instance
@param forEachCallback A callback function to invoke for each of the collapsed element
Collapse all selected blocks return single HTML elements for each block @param editor The editor instance @param forEachCallback A callback function to invoke for each of the collapsed element
function collapseSelectedBlocked(editor, forEachCallback) {
    var traverser = editor.getSelectionTraverser();
    var block = traverser && traverser.currentBlockElement;
    var blocks = [];
    while (block) {
        if (!isEmptyBlockUnderTR(block)) {
            blocks.push(block);
        }
        block = traverser.getNextBlockElement();
    }
    blocks.forEach(function (block) {
        var element = block.collapseToSingleElement();
        forEachCallback(element);
    });
}
function collapseSelectedBlocked ( editor , forEachCallback ) { var traverser = editor . getSelectionTraverser ( ) ; var block = traverser && traverser . currentBlockElement ; var blocks = [ ] ; while ( block ) { if ( ! isEmptyBlockUnderTR ( block ) ) { blocks . push ( block ) ; } block = traverser . getNextBlockElement ( ) ; } blocks . forEach ( function ( block ) { var element = block . collapseToSingleElement ( ) ; forEachCallback ( element ) ; } ) ; }
Collapse all selected blocks, return single HTML elements for each block
 @param editor The editor instance
 @param forEachCallback A callback function to invoke for each of the collapsed element
Collapse all selected blocks return single HTML elements for each block @param editor The editor instance @param forEachCallback A callback function to invoke for each of the collapsed element