JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4b
[ckeditor.git] / _source / core / dom / node.js
index 2ae3a13..02a726c 100644 (file)
@@ -657,6 +657,27 @@ CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype,
                                        child.parentNode.removeChild( child ) ;\r
                                }\r
                        }\r
+               },\r
+\r
+               isReadOnly : function()\r
+               {\r
+                       var current = this;\r
+                       while( current )\r
+                       {\r
+                               if ( current.type == CKEDITOR.NODE_ELEMENT )\r
+                               {\r
+                                       if ( current.is( 'body' ) || current.getCustomData( '_cke_notReadOnly' ) )\r
+                                               break;\r
+\r
+                                       if ( current.getAttribute( 'contentEditable' ) == 'false' )\r
+                                               return current;\r
+                                       else if ( current.getAttribute( 'contentEditable' ) == 'true' )\r
+                                               break;\r
+                               }\r
+                               current = current.getParent();\r
+                       }\r
+\r
+                       return false;\r
                }\r
        }\r
 );\r