How to use the roosterjs-editor-api.toggleHeader function in roosterjs-editor-api

To help you get started, we’ve selected a few roosterjs-editor-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / roosterjs-react / packages / roosterjs-react-command-bar / lib / utils / OutOfBoxCommandBarButtons.tsx View on Github external
function _handleChangeForHeader(editor: Editor, props: RoosterCommandBarProps, state: RoosterCommandBarState): void {
    if (state.formatState.headerLevel === this.headerLevel) {
        toggleHeader(editor, 0);
    } else {
        toggleHeader(editor, this.headerLevel);
    }
}
github microsoft / roosterjs / sample / scripts / initFormatBar.ts View on Github external
document.getElementById('header').addEventListener('change', function() {
        let select = document.getElementById('header') as HTMLSelectElement;
        let level = parseInt(select.value);
        toggleHeader(getCurrentEditor(), level);
        select.value = '-1';
    });
github microsoft / roosterjs / publish / samplesite / scripts / controls / ribbon / ribbonButtons.ts View on Github external
        onClick: (editor, value) => toggleHeader(editor, parseInt(value)),
        dropDownItems: {
github microsoft / roosterjs-react / packages / roosterjs-react-command-bar / lib / utils / OutOfBoxCommandBarButtons.tsx View on Github external
function _handleChangeForHeader(editor: Editor, props: RoosterCommandBarProps, state: RoosterCommandBarState): void {
    if (state.formatState.headerLevel === this.headerLevel) {
        toggleHeader(editor, 0);
    } else {
        toggleHeader(editor, this.headerLevel);
    }
}