From ea1b2a91a7c2d76aea0cc4f8620d67f5e49b24b5 Mon Sep 17 00:00:00 2001 From: Jeroen Akkerman Date: Sun, 3 Dec 2017 00:06:53 +0100 Subject: [PATCH] FontAwesome 5 compatibility * Icons from FA5 should now work, but you have to use the fa-v4-shims to get all the icons right. * FA4 icons still work like they used to. --- src/js/simplemde.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/simplemde.js b/src/js/simplemde.js index 016d693..f7923ce 100644 --- a/src/js/simplemde.js +++ b/src/js/simplemde.js @@ -109,7 +109,12 @@ function createIcon(options, enableTooltips, shortcuts) { } el.tabIndex = -1; - el.className = options.className; + + // Create icon element and append as a child to the button. + var icon = document.createElement("i"); + icon.className = options.className; + el.appendChild(icon); + return el; } @@ -2025,4 +2030,4 @@ SimpleMDE.prototype.toTextArea = function() { } }; -module.exports = SimpleMDE; \ No newline at end of file +module.exports = SimpleMDE;