Skip to content

Commit

Permalink
Bug fix for wrong indention type of list
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Samsel committed Sep 7, 2017
1 parent 5308b70 commit af3f370
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion plugins/indentlist/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,19 @@
listArray[ i ].indent += indentOffset;
// Make sure the newly created sublist get a brand-new element of the same type. (http://dev.ckeditor.com/ticket/5372)
if ( indentOffset > 0 ) {
var listRoot = listArray[ i ].parent;
var listRoot;

for ( var j = i - 1; j >= 0; j-- ) {
if ( listArray[ j ].indent === indentOffset ) {
listRoot = listArray[ j ].parent;
break;
}
}

if ( listRoot === undefined ) {
listRoot = listArray[ i ].parent;
}

listArray[ i ].parent = new CKEDITOR.dom.element( listRoot.getName(), listRoot.getDocument() );
}
}
Expand Down

0 comments on commit af3f370

Please sign in to comment.