mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-24 10:24:29 -06:00
Fix icon class handling if no custom icon classes are provided
This commit is contained in:
parent
cc0706bfc2
commit
de1f32bd1f
@ -168,13 +168,12 @@ function createToolbarButton(options, enableActions, enableTooltips, shortcuts,
|
||||
}
|
||||
|
||||
// Prevent errors if there is no class name in custom options
|
||||
var className = '';
|
||||
var classNameParts = [];
|
||||
if(typeof options.className !== 'undefined') {
|
||||
className = options.className;
|
||||
classNameParts = options.className.split(' ');
|
||||
}
|
||||
|
||||
// Provide backwards compatibility with simple-markdown-editor by adding custom classes to the button.
|
||||
var classNameParts = className.split(' ');
|
||||
var iconClasses = [];
|
||||
for (var classNameIndex = 0; classNameIndex < classNameParts.length; classNameIndex++) {
|
||||
var classNamePart = classNameParts[classNameIndex];
|
||||
|
Loading…
x
Reference in New Issue
Block a user