mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-15 20:25:17 +02:00
toolbarTips option added
This commit is contained in:
parent
c089fc5753
commit
8f1c54b7dd
|
@ -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`.
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue