Title attributes added to toolbar buttons

pull/75/head
Wes Cossick 9 years ago
parent 1c1f3fdecd
commit c089fc5753

@ -40,6 +40,9 @@ function createIcon(name, options) {
el.title = el.title.replace('Alt', '⌥'); el.title = el.title.replace('Alt', '⌥');
} }
} }
if(options.title)
el.title = options.title;
el.className = options.className || 'icon-' + name; el.className = options.className || 'icon-' + name;
return el; return el;
@ -393,46 +396,54 @@ function wordCount(data) {
var toolbar = [{ var toolbar = [{
name: 'bold', name: 'bold',
action: toggleBold, action: toggleBold,
className: "fa fa-bold" className: "fa fa-bold",
}, { title: "Bold",
},
{
name: 'italic', name: 'italic',
action: toggleItalic, action: toggleItalic,
className: "fa fa-italic" className: "fa fa-italic",
title: "Italic",
}, },
'|', '|',
{ {
name: 'quote', name: 'quote',
action: toggleBlockquote, action: toggleBlockquote,
className: "fa fa-quote-left" className: "fa fa-quote-left",
}, { title: "Quote",
},
{
name: 'unordered-list', name: 'unordered-list',
action: toggleUnOrderedList, action: toggleUnOrderedList,
className: "fa fa-list-ul" className: "fa fa-list-ul",
}, { title: "Generic List",
},
{
name: 'ordered-list', name: 'ordered-list',
action: toggleOrderedList, action: toggleOrderedList,
className: "fa fa-list-ol" className: "fa fa-list-ol",
title: "Numbered List",
}, },
'|', '|',
{ {
name: 'link', name: 'link',
action: drawLink, action: drawLink,
className: "fa fa-link" className: "fa fa-link",
}, { title: "Create Link",
},
{
name: 'image', name: 'image',
action: drawImage, action: drawImage,
className: "fa fa-picture-o" className: "fa fa-picture-o",
title: "Insert Image",
}, },
'|', '|',
{ {
name: 'preview', name: 'preview',
action: togglePreview, action: togglePreview,
className: "fa fa-eye" className: "fa fa-eye",
}, title: "Toggle Preview",
]; }];
/** /**
* Interface of SimpleMDE. * Interface of SimpleMDE.

Loading…
Cancel
Save