JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4b
[ckeditor.git] / _source / plugins / div / plugin.js
index 3a7ec8d..158070f 100644 (file)
@@ -12,7 +12,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 {\r
        CKEDITOR.plugins.add( 'div',\r
        {\r
-               requires : [ 'editingblock', 'domiterator' ],\r
+               requires : [ 'editingblock', 'domiterator', 'styles' ],\r
 \r
                init : function( editor )\r
                {\r
@@ -47,7 +47,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                for ( var i = 0 ; i < ranges.length ; i++ )\r
                                                {\r
                                                        range = ranges[ i ];\r
-                                                       if( range.collapsed )\r
+                                                       if ( range.collapsed )\r
                                                                findDiv( selection.getStartElement() );\r
                                                        else\r
                                                        {\r
@@ -95,7 +95,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                {\r
                                        editor.contextMenu.addListener( function( element, selection )\r
                                                {\r
-                                                       if ( !element )\r
+                                                       if ( !element || element.isReadOnly())\r
                                                                return null;\r
 \r
                                                        var elementPath = new CKEDITOR.dom.elementPath( element ),\r