|
|
@@ -207,6 +207,7 @@ export function positionAfterUiElements( viewPosition ) {
|
|
|
* @param {Boolean} [options.sameIndent=false] Whether the sought sibling should have the same indentation.
|
|
|
* @param {Boolean} [options.smallerIndent=false] Whether the sought sibling should have a smaller indentation.
|
|
|
* @param {Number} [options.listIndent] The reference indentation.
|
|
|
+ * @param {'forward'|'backward'} [options.direction='backward'] Walking direction.
|
|
|
* @returns {module:engine/model/item~Item|null}
|
|
|
*/
|
|
|
export function getSiblingListItem( modelItem, options ) {
|
|
|
@@ -223,7 +224,11 @@ export function getSiblingListItem( modelItem, options ) {
|
|
|
return item;
|
|
|
}
|
|
|
|
|
|
- item = item.previousSibling;
|
|
|
+ if ( options.direction === 'forward' ) {
|
|
|
+ item = item.nextSibling;
|
|
|
+ } else {
|
|
|
+ item = item.previousSibling;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return null;
|