diff --git a/src/case/richeditor/plugins/button.bold.js b/src/case/richeditor/plugins/button.bold.js index ac788559b..9afe0d2be 100644 --- a/src/case/richeditor/plugins/button.bold.js +++ b/src/case/richeditor/plugins/button.bold.js @@ -30,6 +30,22 @@ BI.RichEditorBoldButton = BI.inherit(BI.RichEditorAction, { self.doCommand(); }); }, + + checkNodes: function (e) { + var self = this; + try { + BI.defer(function() { + if(document.queryCommandState("bold") ) { + self.activate(); + } else { + self.deactivate(); + } + }); + } catch (error) { + BI.RichEditorBoldButton.superclass.checkNodes(e); + } + }, + activate: function () { this.bold.setSelected(true); }, diff --git a/src/case/richeditor/plugins/button.italic.js b/src/case/richeditor/plugins/button.italic.js index a006dfa68..b816826e5 100644 --- a/src/case/richeditor/plugins/button.italic.js +++ b/src/case/richeditor/plugins/button.italic.js @@ -30,6 +30,22 @@ BI.RichEditorItalicButton = BI.inherit(BI.RichEditorAction, { self.doCommand(); }); }, + + checkNodes: function (e) { + var self = this; + try { + BI.defer(function() { + if(document.queryCommandState("italic") ) { + self.activate(); + } else { + self.deactivate(); + } + }); + } catch (error) { + BI.RichEditorBoldButton.superclass.checkNodes(e); + } + }, + activate: function () { this.italic.setSelected(true); }, diff --git a/src/case/richeditor/plugins/button.underline.js b/src/case/richeditor/plugins/button.underline.js index 21e60c5a8..cd3d30a73 100644 --- a/src/case/richeditor/plugins/button.underline.js +++ b/src/case/richeditor/plugins/button.underline.js @@ -30,6 +30,22 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, { self.doCommand(); }); }, + + checkNodes: function (e) { + var self = this; + try { + BI.defer(function() { + if(document.queryCommandState("underline") ) { + self.activate(); + } else { + self.deactivate(); + } + }); + } catch (error) { + BI.RichEditorBoldButton.superclass.checkNodes(e); + } + }, + activate: function () { this.underline.setSelected(true); }, diff --git a/src/case/richeditor/plugins/combo.colorchooser.js b/src/case/richeditor/plugins/combo.colorchooser.js index f68389912..e7ca5409b 100644 --- a/src/case/richeditor/plugins/combo.colorchooser.js +++ b/src/case/richeditor/plugins/combo.colorchooser.js @@ -32,9 +32,13 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { var value = this.getValue(); // 用span代替font - document.execCommand('styleWithCSS', null, true); - self.doCommand(this.getValue() || "inherit"); - document.execCommand('styleWithCSS', null, false); + if(BI.isIE() && BI.getIEVersion() < 11) { + self.doCommand(this.getValue()); + } else { + document.execCommand('styleWithCSS', null, true); + self.doCommand(this.getValue() || "inherit"); + document.execCommand('styleWithCSS', null, false); + } }); },