src/js/inscrybmde.js
function toggleFullScreen(editor) {
    // Set fullscreen
    var cm = editor.codemirror;
    cm.setOption('fullScreen', !cm.getOption('fullScreen'));


    // Prevent scrolling on body during fullscreen active
    if (cm.getOption('fullScreen')) {
        saved_overflow = document.body.style.overflow;
        document.body.style.overflow = 'hidden';
    } else {
        document.body.style.overflow = saved_overflow;
    }


    // Update toolbar class
    var wrap = cm.getWrapperElement();

    if (!/fullscreen/.test(wrap.previousSibling.className)) {
        wrap.previousSibling.className += ' fullscreen';
    } else {
        wrap.previousSibling.className = wrap.previousSibling.className.replace(/\s*fullscreen\b/, '');
    }


    // Update toolbar button
    if (editor.toolbarElements.fullscreen) {
        var toolbarButton = editor.toolbarElements.fullscreen;

        if (!/active/.test(toolbarButton.className)) {
            toolbarButton.className += ' active';
        } else {
            toolbarButton.className = toolbarButton.className.replace(/\s*active\s*/g, '');
        }
    }


    // Hide side by side if needed
    var sidebyside = cm.getWrapperElement().nextSibling;
    if (/editor-preview-active-side/.test(sidebyside.className))
        toggleSideBySide(editor);
}
function toggleFullScreen(editor) {
    // Set fullscreen
    var cm = editor.codemirror;
    cm.setOption('fullScreen', !cm.getOption('fullScreen'));


    // Prevent scrolling on body during fullscreen active
    if (cm.getOption('fullScreen')) {
        saved_overflow = document.body.style.overflow;
        document.body.style.overflow = 'hidden';
    } else {
        document.body.style.overflow = saved_overflow;
    }


    // Update toolbar class
    var wrap = cm.getWrapperElement();

    if (!/fullscreen/.test(wrap.previousSibling.className)) {
        wrap.previousSibling.className += ' fullscreen';
    } else {
        wrap.previousSibling.className = wrap.previousSibling.className.replace(/\s*fullscreen\b/, '');
    }


    // Update toolbar button
    if (editor.toolbarElements.fullscreen) {
        var toolbarButton = editor.toolbarElements.fullscreen;

        if (!/active/.test(toolbarButton.className)) {
            toolbarButton.className += ' active';
        } else {
            toolbarButton.className = toolbarButton.className.replace(/\s*active\s*/g, '');
        }
    }


    // Hide side by side if needed
    var sidebyside = cm.getWrapperElement().nextSibling;
    if (/editor-preview-active-side/.test(sidebyside.className))
        toggleSideBySide(editor);
}
function toggleFullScreen ( editor ) { // Set fullscreen var cm = editor . codemirror ; cm . setOption ( 'fullScreen' , ! cm . getOption ( 'fullScreen' ) ) ; // Prevent scrolling on body during fullscreen active if ( cm . getOption ( 'fullScreen' ) ) { saved_overflow = document . body . style . overflow ; document . body . style . overflow = 'hidden' ; } else { document . body . style . overflow = saved_overflow ; } // Update toolbar class var wrap = cm . getWrapperElement ( ) ; if ( ! / fullscreen / . test ( wrap . previousSibling . className ) ) { wrap . previousSibling . className += ' fullscreen' ; } else { wrap . previousSibling . className = wrap . previousSibling . className . replace ( / \s*fullscreen\b / , '' ) ; } // Update toolbar button if ( editor . toolbarElements . fullscreen ) { var toolbarButton = editor . toolbarElements . fullscreen ; if ( ! / active / . test ( toolbarButton . className ) ) { toolbarButton . className += ' active' ; } else { toolbarButton . className = toolbarButton . className . replace ( / \s*active\s* / g , '' ) ; } } // Hide side by side if needed var sidebyside = cm . getWrapperElement ( ) . nextSibling ; if ( / editor-preview-active-side / . test ( sidebyside . className ) ) toggleSideBySide ( editor ) ; }
Toggle full screen of the editor.
Toggle full screen of the editor .