JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2.1
[ckeditor.git] / _source / plugins / indent / plugin.js
index e9992bd..d61e6a6 100644 (file)
@@ -135,8 +135,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                // Apply indenting or outdenting on the array.\r
                var baseIndent = listArray[ lastItem.getCustomData( 'listarray_index' ) ].indent;\r
-               for ( i = startItem.getCustomData( 'listarray_index' ) ; i <= lastItem.getCustomData( 'listarray_index' ) ; i++ )\r
-                       listArray[i].indent += indentOffset;\r
+               for ( i = startItem.getCustomData( 'listarray_index' ); i <= lastItem.getCustomData( 'listarray_index' ); i++ )\r
+               {\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
+               }\r
+\r
                for ( i = lastItem.getCustomData( 'listarray_index' ) + 1 ;\r
                                i < listArray.length && listArray[i].indent > baseIndent ; i++ )\r
                        listArray[i].indent += indentOffset;\r
@@ -225,7 +231,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                if ( indentStep < 1 )\r
                                        block.$.className = className;\r
                                else\r
-                                       block.addClass( editor.config.indentClasses[ indentStep - 1 ] );\r
+                                       block.$.className = CKEDITOR.tools.ltrim( className + ' ' + editor.config.indentClasses[ indentStep - 1 ] );\r
                        }\r
                        else\r
                        {\r
@@ -255,6 +261,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                }\r
                else\r
                        this.indentCssProperty = editor.config.contentsLangDirection == 'ltr' ? 'margin-left' : 'margin-right';\r
+               this.startDisabled = name == 'outdent';\r
        }\r
 \r
        indentCommand.prototype = {\r
@@ -325,6 +332,31 @@ CKEDITOR.tools.extend( CKEDITOR.config,
 /**\r
  * Size of each indentation step\r
  * @type Number\r
+ * @example\r
+ * config.indentOffset = 40;\r
+ */\r
+\r
+ /**\r
+ * Unit for the indentation style\r
+ * @type String\r
+ * @example\r
+ * config.indentUnit = 'px';\r
+ */\r
+\r
+ /**\r
+ * List of classes to use for indenting the contents.\r
+ * @type Array\r
+ * @example\r
+ * // Don't use classes for indenting. (this is the default value)\r
+ * config.indentClasses = null;\r
+ * @example\r
+ * // Use the classes 'Indent1', 'Indent2', 'Indent3'\r
+ * config.indentClasses = ['Indent1', 'Indent2', 'Indent3'];\r
+ */\r
+\r
+/**\r
+ * Size of each indentation step\r
+ * @type Number\r
  * @default 40\r
  * @example\r
  * config.indentOffset = 4;\r