[minor] fixed firefox NS Unexpected Error
This commit is contained in:
parent
0fa85213bb
commit
610fad4657
1 changed files with 9 additions and 1 deletions
|
|
@ -384,7 +384,15 @@ bsEditorToolbar = Class.extend({
|
|||
if (this.toolbar) {
|
||||
$(this.toolbar).find('.btn[data-' + this.options.command_role + ']').each(function () {
|
||||
var command = $(this).data(me.options.command_role);
|
||||
if (document.queryCommandState(command)) {
|
||||
|
||||
// try catch for buggy firefox!
|
||||
try {
|
||||
var query_command_state = document.queryCommandState(command);
|
||||
} catch(e) {
|
||||
var query_command_state = false;
|
||||
}
|
||||
|
||||
if (query_command_state) {
|
||||
$(this).addClass(me.options.active_toolbar_class);
|
||||
} else {
|
||||
$(this).removeClass(me.options.active_toolbar_class);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue