diff --git a/bootstrap-wysiwyg.js b/bootstrap-wysiwyg.js index 69f64a7..9b94eeb 100644 --- a/bootstrap-wysiwyg.js +++ b/bootstrap-wysiwyg.js @@ -26,11 +26,13 @@ updateToolbar = function () { if (options.activeToolbarClass) { $(options.toolbarSelector).find(toolbarBtnSelector).each(function () { - var command = $(this).data(options.commandRole); - if (document.queryCommandState(command)) { - $(this).addClass(options.activeToolbarClass); - } else { - $(this).removeClass(options.activeToolbarClass); + var command = $(this).data(options.commandRole).split(' ')[0]; + if (document.queryCommandSupported(command)) { + if (document.queryCommandState(command)) { + $(this).addClass(options.activeToolbarClass); + } else { + $(this).removeClass(options.activeToolbarClass); + } } }); }