diff --git a/README.md b/README.md index 922da8b..906bcd0 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ simplemde.value(); - **status**: If set to `false`, hide the status bar. Defaults to `true`. - Optionally, you can set an array of status bar elements to include, and in what order. - **toolbar**: If set to `false`, hide the toolbar. Defaults to `true`. +- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`. - **autofocus**: If set to `true`, autofocuses the editor. Defaults to `false`. - **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`. - **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`. diff --git a/source files/simplemde.js b/source files/simplemde.js index 645f0f6..0353f45 100644 --- a/source files/simplemde.js +++ b/source files/simplemde.js @@ -27,9 +27,10 @@ function fixShortcut(name) { /** * Create icon element for toolbar. */ -function createIcon(name, options) { +function createIcon(name, options, enableTooltips) { options = options || {}; var el = document.createElement('a'); + enableTooltips = (enableTooltips == undefined) ? true : enableTooltips; var shortcut = options.shortcut || shortcuts[name]; if (shortcut) { @@ -41,7 +42,7 @@ function createIcon(name, options) { } } - if(options.title) + if(options.title && enableTooltips) el.title = options.title; el.className = options.className || 'icon-' + name; @@ -611,7 +612,7 @@ SimpleMDE.prototype.createToolbar = function(items) { (function(item) { var el; if (item.name) { - el = createIcon(item.name, item); + el = createIcon(item.name, item, self.options.toolbarTips); } else if (item === '|') { el = createSep(); } else {