From 9999fd93c1d98809cf94027afd0cd0ca23498f14 Mon Sep 17 00:00:00 2001 From: Wes Cossick Date: Fri, 26 Jun 2015 12:45:54 -0500 Subject: [PATCH] Fix bug with toolbar not hiding --- README.md | 8 ++++---- source files/markdownify.js | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e6cc35c..05bb11a 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,13 @@ simplemde.codemirror.getValue(); - **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. -- **tools**: If set false, hide the toolbar. Defaults to true. +- **toolbar**: If set false, hide the toolbar. Defaults to true. ``` new SimpleMDE({ - element: document.getElementById("MyID"), - status: false, - tools: false, + element: document.getElementById("MyID"), + status: false, + toolbar: false, }); ``` diff --git a/source files/markdownify.js b/source files/markdownify.js index 4560574..3c73ee4 100644 --- a/source files/markdownify.js +++ b/source files/markdownify.js @@ -443,8 +443,11 @@ function SimpleMDE(options) { if (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 // [{name: 'bold', shortcut: 'Ctrl-B', className: 'icon-bold'}]