JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.6.1
[ckeditor.git] / _source / plugins / indent / plugin.js
index b0c82bf..e5db0b2 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -142,8 +142,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                {\r
                                        listArray[ i ].indent += indentOffset;\r
                                        // Make sure the newly created sublist get a brand-new element of the same type. (#5372)\r
-                                       var listRoot = listArray[ i ].parent;\r
-                                       listArray[ i ].parent = new CKEDITOR.dom.element( listRoot.getName(), listRoot.getDocument() );\r
+                                       if ( indentOffset > 0 )\r
+                                       {\r
+                                               var listRoot = listArray[ i ].parent;\r
+                                               listArray[ i ].parent = new CKEDITOR.dom.element( listRoot.getName(), listRoot.getDocument() );\r
+                                       }\r
                                }\r
 \r
                                for ( i = lastItem.getCustomData( 'listarray_index' ) + 1 ;\r