toolbarTips option added

pull/23/head
Wes Cossick 9 years ago
parent c089fc5753
commit 8f1c54b7dd

@ -55,6 +55,7 @@ simplemde.value();
- **status**: If set to `false`, hide the status bar. Defaults to `true`. - **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. - 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`. - **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`. - **autofocus**: If set to `true`, autofocuses the editor. Defaults to `false`.
- **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`. - **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`. - **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.

@ -27,9 +27,10 @@ function fixShortcut(name) {
/** /**
* Create icon element for toolbar. * Create icon element for toolbar.
*/ */
function createIcon(name, options) { function createIcon(name, options, enableTooltips) {
options = options || {}; options = options || {};
var el = document.createElement('a'); var el = document.createElement('a');
enableTooltips = (enableTooltips == undefined) ? true : enableTooltips;
var shortcut = options.shortcut || shortcuts[name]; var shortcut = options.shortcut || shortcuts[name];
if (shortcut) { if (shortcut) {
@ -41,7 +42,7 @@ function createIcon(name, options) {
} }
} }
if(options.title) if(options.title && enableTooltips)
el.title = options.title; el.title = options.title;
el.className = options.className || 'icon-' + name; el.className = options.className || 'icon-' + name;
@ -611,7 +612,7 @@ SimpleMDE.prototype.createToolbar = function(items) {
(function(item) { (function(item) {
var el; var el;
if (item.name) { if (item.name) {
el = createIcon(item.name, item); el = createIcon(item.name, item, self.options.toolbarTips);
} else if (item === '|') { } else if (item === '|') {
el = createSep(); el = createSep();
} else { } else {

Loading…
Cancel
Save