JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.3
[ckeditor.git] / _source / plugins / blockquote / plugin.js
index 4015bee..f17aec2 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, 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
@@ -25,8 +25,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
        function onSelectionChange( evt )\r
        {\r
-               var editor = evt.editor,\r
-                       command = editor.getCommand( 'blockquote' );\r
+               var editor = evt.editor;\r
+               if ( editor.readOnly )\r
+                       return;\r
+\r
+               var command = editor.getCommand( 'blockquote' );\r
                command.state = getState( editor, evt.data.path );\r
                command.fire( 'state' );\r
        }\r
@@ -47,7 +50,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                {\r
                        var state = editor.getCommand( 'blockquote' ).state,\r
                                selection = editor.getSelection(),\r
-                               range = selection && selection.getRanges()[0];\r
+                               range = selection && selection.getRanges( true )[0];\r
 \r
                        if ( !range )\r
                                return;\r
@@ -95,6 +98,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                        var iterator = range.createIterator(),\r
                                block;\r
+                       iterator.enlargeBr = editor.config.enterMode != CKEDITOR.ENTER_BR;\r
 \r
                        if ( state == CKEDITOR.TRISTATE_OFF )\r
                        {\r