sparksuite / simplemde-markdown-editor

A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://simplemde.com
MIT License
9.79k stars 1.12k forks source link

Can't hide and toggle fullscreen or side-by-side #830

Open AbigailF opened 2 years ago

AbigailF commented 2 years ago

Hello, I want to hide fullscreen and side-by-side buttons and set default values to fullscreen enabled with side-by-side enabled. My code:

var simplemde = new SimpleMDE({
            element: document.getElementById("editor"),
            autofocus: true,
            hideIcons: ["guide", "preview", "fullscreen", "side-by-side"]}, );
        simplemde.toggleFullScreen()
        simplemde.toggleSideBySide()

But, when I check website source code the

is empty...

Snímek obrazovky 2022-02-20 v 20 20 57

Is there any options how to hide buttons for fullscreen and side-by-side while having them enabled ?

gvitalie commented 8 months ago

Good morning, even if it is evening.

You can use hideIcons field, but You have a wrong placed comma after }, parenthesis.

Your code

var simplemde = new SimpleMDE({
            element: document.getElementById("editor"),
            autofocus: true,
            hideIcons: ["guide", "preview", "fullscreen", "side-by-side"]}, );

Corrected

var simplemde = new SimpleMDE({
            element: document.getElementById("editor"),
            autofocus: true,
            hideIcons: ["guide", "preview", "fullscreen", "side-by-side"],
});

P.S.: Test-drive SimpleMDE with LaTeX feature