Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prevented Firefox from using inline styles

  • Loading branch information...
commit 5c350fbf79092ff9797da28114cc301f645649dd 1 parent b70c92c
@andymason andymason authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 jquery.richeditor.js
View
15 jquery.richeditor.js
@@ -3,6 +3,7 @@
Version: 0.1
*/
(function($) {
+
var buttonConfigs = {
bold: {
text: 'B',
@@ -67,6 +68,17 @@
btnElm.bind('mousedown', function(e) {
e.preventDefault();
var param = (btn.action) ? btn.action() : false;
+ // Force content editable not to use inline style
+ try {
+ document.execCommand("styleWithCSS", false, false);
+ } catch (e) {
+ try {
+ Editor.execCommand("useCSS", false, true);
+ } catch (e) {
+ // Do something else?
+ }
+ }
+
document.execCommand(btn.execCommand, false, param);
});
@@ -135,8 +147,7 @@
var controls = buildControls(config.buttons);
editorContainer.append(controls);
- editorContainer.attr('id', this.attr('id'))
- ;
+ editorContainer.attr('id', this.attr('id'));
editorPane.attr('contenteditable', 'true');
editorPane.bind('paste', pasteClipboard);
Please sign in to comment.
Something went wrong with that request. Please try again.