JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.4
[ckeditor.git] / _source / plugins / indent / plugin.js
index 1e3ec49..7b28c77 100644 (file)
@@ -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
@@ -425,25 +428,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                        }\r
                                }\r
                        });\r
-\r
-                       editor.on( 'key', function( evt )\r
-                       {\r
-                               // Backspace at the beginning of  list item should outdent it.\r
-                               if ( editor.mode == 'wysiwyg' && evt.data.keyCode == 8 )\r
-                               {\r
-                                       var sel = editor.getSelection(),\r
-                                               range = sel.getRanges()[ 0 ],\r
-                                               li;\r
-\r
-                                       if ( range.collapsed &&\r
-                                                ( li = range.startContainer.getAscendant( 'li', 1 ) ) &&\r
-                                                range.checkBoundaryOfElement( li, CKEDITOR.START ) )\r
-                                       {\r
-                                               editor.execCommand( 'outdent' );\r
-                                               evt.cancel();\r
-                                       }\r
-                               }\r
-                       });\r
                },\r
 \r
                requires : [ 'domiterator', 'list' ]\r