RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/**
 * Execute a document command
 * @param editor The editor instance
 * @param command The command to execute
 * @param addUndoSnapshotWhenCollapsed Optional, set to true to always add undo snapshot even current selection is collapsed.
 * Default value is false.
 * @param doWorkaroundForList Optional, set to true to do workaround for list in order to keep current format.
 * Default value is false.
 */
Execute a document command
@param editor The editor instance
@param command The command to execute
@param addUndoSnapshotWhenCollapsed Optional, set to true to always add undo snapshot even current selection is collapsed.
Default value is false.
@param doWorkaroundForList Optional, set to true to do workaround for list in order to keep current format.
Default value is false.
Execute a document command @param editor The editor instance @param command The command to execute @param addUndoSnapshotWhenCollapsed Optional set to true to always add undo snapshot even current selection is collapsed . Default value is false . @param doWorkaroundForList Optional set to true to do workaround for list in order to keep current format . Default value is false .
function execCommand(editor, command) {
    editor.focus();
    var formatter = function () { return editor.getDocument().execCommand(command, false, null); };
    var range = editor.getSelectionRange();
    if (range && range.collapsed) {
        editor.addUndoSnapshot();
        formatter();
        if (isPendableFormatCommand(command)) {
            editor.triggerPluginEvent(12 , {
                formatState: roosterjs_editor_dom_1.getPendableFormatState(editor.getDocument()),
            });
        }
    }
    else {
        editor.addUndoSnapshot(formatter, "Format" );
    }
}
function execCommand ( editor , command ) { editor . focus ( ) ; var formatter = function ( ) { return editor . getDocument ( ) . execCommand ( command , false , null ) ; } ; var range = editor . getSelectionRange ( ) ; if ( range && range . collapsed ) { editor . addUndoSnapshot ( ) ; formatter ( ) ; if ( isPendableFormatCommand ( command ) ) { editor . triggerPluginEvent ( 12 , { formatState : roosterjs_editor_dom_1 . getPendableFormatState ( editor . getDocument ( ) ) , } ) ; } } else { editor . addUndoSnapshot ( formatter , "Format" ) ; } }
Execute a document command
 @param editor The editor instance
 @param command The command to execute
 @param addUndoSnapshotWhenCollapsed Optional, set to true to always add undo snapshot even current selection is collapsed.
Execute a document command @param editor The editor instance @param command The command to execute @param addUndoSnapshotWhenCollapsed Optional set to true to always add undo snapshot even current selection is collapsed .
// Trigger PendingFormatStateChanged event since we changed pending format state /* PendingFormatStateChanged */ /* Format */