JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1.1
[ckeditor.git] / _source / plugins / justify / plugin.js
index 95bc5b2..a3ff0dd 100644 (file)
@@ -66,7 +66,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
        justifyCommand.prototype = {\r
                exec : function( editor )\r
                {\r
-                       var selection = editor.getSelection();\r
+                       var selection = editor.getSelection(),\r
+                               enterMode = editor.config.enterMode;\r
+\r
                        if ( !selection )\r
                                return;\r
 \r
@@ -80,6 +82,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        for ( var i = ranges.length - 1 ; i >= 0 ; i-- )\r
                        {\r
                                iterator = ranges[ i ].createIterator();\r
+                               iterator.enlargeBr = enterMode != CKEDITOR.ENTER_BR;\r
+\r
                                while ( ( block = iterator.getNextParagraph() ) )\r
                                {\r
                                        block.removeAttribute( 'align' );\r