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 onFullScreen = editor.onFullScreen;
	var wrap = cm.getWrapperElement();
	if(!/fullscreen/.test(wrap.previousSibling.className)) {
		wrap.previousSibling.className += " fullscreen";
		if(onFullScreen) {
			onFullScreen(true);
		}
	} else {
		wrap.previousSibling.className = wrap.previousSibling.className.replace(/\s*fullscreen\b/, "");
		if(onFullScreen) {
			onFullScreen(false);
		}
	}


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