JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.3
[ckeditor.git] / _source / plugins / div / plugin.js
index 463c5f6..4cddea7 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -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
@@ -37,10 +37,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                blockLimit = path.blockLimit,\r
                                                                div = blockLimit.is( 'div' ) && blockLimit;\r
 \r
-                                                       if ( div && !div.getAttribute( '_cke_div_added' ) )\r
+                                                       if ( div && !div.data( 'cke-div-added' ) )\r
                                                        {\r
                                                                toRemove.push( div );\r
-                                                               div.setAttribute( '_cke_div_added' );\r
+                                                               div.data( 'cke-div-added' );\r
                                                        }\r
                                                }\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