2
0
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:
kolaente 2020-03-23 18:18:04 +01:00
parent cc0706bfc2
commit de1f32bd1f
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B

View File

@ -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];