Merge 90a648ea88e96c5618fa73b17a08697d45d837ec into e32fe3f91c2d45f27f72a3662133b1c0e1a5bda1

This commit is contained in:
Wentao Lyu 2017-05-19 13:04:09 +00:00 committed by GitHub
commit dea228b78b
2 changed files with 4 additions and 1 deletions

View File

@ -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 `true`.
- **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`.

View File

@ -696,6 +696,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, ""
@ -706,8 +707,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);