Fix bug with toolbar not hiding

pull/75/head
Wes Cossick 9 years ago
parent 958e3c08c7
commit 9999fd93c1

@ -47,13 +47,13 @@ simplemde.codemirror.getValue();
- **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.
- **status**: If set false, hide the status bar. Defaults to true. - **status**: If set false, hide the status bar. Defaults to true.
- **tools**: If set false, hide the toolbar. Defaults to true. - **toolbar**: If set false, hide the toolbar. Defaults to true.
``` ```
new SimpleMDE({ new SimpleMDE({
element: document.getElementById("MyID"), element: document.getElementById("MyID"),
status: false, status: false,
tools: false, toolbar: false,
}); });
``` ```

@ -443,8 +443,11 @@ function SimpleMDE(options) {
if (options.element) { if (options.element) {
this.element = options.element; this.element = options.element;
} }
options.toolbar = options.toolbar || SimpleMDE.toolbar; if(options.toolbar === false)
options.toolbar = [];
else
options.toolbar = options.toolbar || SimpleMDE.toolbar;
// you can customize toolbar with object // you can customize toolbar with object
// [{name: 'bold', shortcut: 'Ctrl-B', className: 'icon-bold'}] // [{name: 'bold', shortcut: 'Ctrl-B', className: 'icon-bold'}]

Loading…
Cancel
Save