JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6
[ckeditor.git] / _source / plugins / showblocks / plugin.js
index cbec314..6107cdf 100644 (file)
@@ -89,6 +89,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
        var commandDefinition =\r
        {\r
+               readOnly : 1,\r
                preserveState : true,\r
                editorFocus : false,\r
 \r
@@ -100,8 +101,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                refresh : function( editor )\r
                {\r
-                       var funcName = ( this.state == CKEDITOR.TRISTATE_ON ) ? 'addClass' : 'removeClass';\r
-                       editor.document.getBody()[ funcName ]( 'cke_show_blocks' );\r
+                       if ( editor.document )\r
+                       {\r
+                               var funcName = ( this.state == CKEDITOR.TRISTATE_ON ) ? 'addClass' : 'removeClass';\r
+                               editor.document.getBody()[ funcName ]( 'cke_show_blocks' );\r
+                       }\r
                }\r
        };\r
 \r