Skip to content

Commit 1aaab1d

Browse files
committed
Fixed formatBlock buttons being not highlighted in the toolbar
1 parent 9304f95 commit 1aaab1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bootstrap-wysiwyg.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
updateToolbar = function () {
2727
if (options.activeToolbarClass) {
2828
$(options.toolbarSelector).find(toolbarBtnSelector).each(function () {
29-
var command = $(this).data(options.commandRole);
30-
if (document.queryCommandState(command)) {
29+
var command = $(this).data(options.commandRole),
30+
format = command.match(/formatBlock (.+)/);
31+
if (document.queryCommandState(command) || (format && (format[1] == document.queryCommandValue("formatBlock")))) {
3132
$(this).addClass(options.activeToolbarClass);
3233
} else {
3334
$(this).removeClass(options.activeToolbarClass);

0 commit comments

Comments
 (0)