JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6
[ckeditor.git] / _source / plugins / list / plugin.js
index b0676d0..be10d0d 100644 (file)
@@ -218,6 +218,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
        function onSelectionChange( evt )\r
        {\r
+               if ( evt.editor.readOnly )\r
+                       return null;\r
+\r
                var path = evt.data.path,\r
                        blockLimit = path.blockLimit,\r
                        elements = path.elements,\r
@@ -228,8 +231,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                for ( i = 0 ; i < elements.length && ( element = elements[ i ] )\r
                          && !element.equals( blockLimit ); i++ )\r
                {\r
-                       if ( listNodeNames[ elements[i].getName() ] )\r
-                               return this.setState( this.type == elements[i].getName() ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF );\r
+                       if ( listNodeNames[ elements[ i ].getName() ] )\r
+                               return this.setState( this.type == elements[ i ].getName() ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF );\r
                }\r
 \r
                return this.setState( CKEDITOR.TRISTATE_OFF );\r