add forceFullscreen

pull/273/head
eastpiger 8 years ago
parent d77d4b318b
commit 5812bda9fe

@ -78,6 +78,7 @@ simplemde.value("This text will appear in the editor");
- **code** Can be set to ```` ``` ```` or `~~~`. Defaults to ```` ``` ````.
- **italic** Can be set to `*` or `_`. Defaults to `*`.
- **element**: The DOM element for the textarea to use. Defaults to the first textarea on the page.
- **forceFullscreen**: If set to `true`, force enter fullscreen mode when toggle side by side mode. Defaults to `false`.
- **forceSync**: If set to `true`, force text changes made in SimpleMDE to be immediately stored in original textarea. Defaults to `false`.
- **hideIcons**: An array of icon names to hide. Can be used to hide specific icons shown by default without completely customizing the toolbar.
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.

@ -693,6 +693,7 @@ function toggleSideBySide(editor) {
var preview = wrapper.nextSibling;
var toolbarButton = editor.toolbarElements["side-by-side"];
var useSideBySideListener = false;
var options = editor.options;
if(/editor-preview-active-side/.test(preview.className)) {
preview.className = preview.className.replace(
/\s*editor-preview-active-side\s*/g, ""
@ -703,8 +704,9 @@ function toggleSideBySide(editor) {
// When the preview button is clicked for the first time,
// give some time for the transition from editor.css to fire and the view to slide from right to left,
// instead of just appearing.
forceFullscreen = (options.forceFullscreen != undefined) ? options.forceFullscreen : true;
setTimeout(function() {
if(!cm.getOption("fullScreen"))
if(forceFullscreen && !cm.getOption("fullScreen"))
toggleFullScreen(editor);
preview.className += " editor-preview-active-side";
}, 1);

Loading…
Cancel
Save