mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06:00
add forceFullscreen
This commit is contained in:
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 ```` ``` ````.
|
- **code** Can be set to ```` ``` ```` or `~~~`. Defaults to ```` ``` ````.
|
||||||
- **italic** 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.
|
- **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`.
|
- **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.
|
- **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`.
|
- **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 preview = wrapper.nextSibling;
|
||||||
var toolbarButton = editor.toolbarElements["side-by-side"];
|
var toolbarButton = editor.toolbarElements["side-by-side"];
|
||||||
var useSideBySideListener = false;
|
var useSideBySideListener = false;
|
||||||
|
var options = editor.options;
|
||||||
if(/editor-preview-active-side/.test(preview.className)) {
|
if(/editor-preview-active-side/.test(preview.className)) {
|
||||||
preview.className = preview.className.replace(
|
preview.className = preview.className.replace(
|
||||||
/\s*editor-preview-active-side\s*/g, ""
|
/\s*editor-preview-active-side\s*/g, ""
|
||||||
@ -703,8 +704,9 @@ function toggleSideBySide(editor) {
|
|||||||
// When the preview button is clicked for the first time,
|
// 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,
|
// give some time for the transition from editor.css to fire and the view to slide from right to left,
|
||||||
// instead of just appearing.
|
// instead of just appearing.
|
||||||
|
forceFullscreen = (options.forceFullscreen != undefined) ? options.forceFullscreen : true;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if(!cm.getOption("fullScreen"))
|
if(forceFullscreen && !cm.getOption("fullScreen"))
|
||||||
toggleFullScreen(editor);
|
toggleFullScreen(editor);
|
||||||
preview.className += " editor-preview-active-side";
|
preview.className += " editor-preview-active-side";
|
||||||
}, 1);
|
}, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user