Options
All
  • Public
  • Public/Protected
  • All
Menu

!!! Never directly create instance of this class. It should be created within VList class !!!

Represent a list item.

A list item is normally wrapped using a LI tag. But this class is only a logical item, it can be a LI tag, or another other type of node which means it is actually not a list item. That can happen after we do "outdent" on a 1-level list item, then it becomes not a list item.

Hierarchy

  • VListItem

Index

Constructors

constructor

Methods

addNegativeMargins

  • addNegativeMargins(): void

applyListStyle

  • applyListStyle(rootList: HTMLUListElement | HTMLOListElement, index: number): void

canMerge

changeListType

contains

  • contains(node: Node): boolean

getLevel

  • getLevel(): number

getListType

getNewListStart

  • getNewListStart(): number

getNode

  • getNode(): HTMLLIElement

indent

  • indent(): void

isDummy

  • isDummy(): boolean
  • Check if this item is a dummy item. A dummy item is also represented by LI tag, but it won't render a bullet (for Unordered list) or a number (for Ordered list) normally it has CSS style display set to a value other than "list-item"

    Returns boolean

isOrphanItem

  • isOrphanItem(): boolean

mergeItems

outdent

  • outdent(preventItemRemoval?: boolean): void
  • Outdent this item If this item is already not an list item, it will be no op

    Parameters

    • preventItemRemoval: boolean = false

      Whether prevent the list item to be removed for the listItem by default false

    Returns void

setIsDummy

  • setIsDummy(isDummy: boolean): void

setNewListStart

  • setNewListStart(startNumber: number): void

writeBack

  • writeBack(listStack: Node[], originalRoot?: HTMLUListElement | HTMLOListElement, shouldReuseAllAncestorListElements?: boolean): void
  • Write the change result back into DOM

    Parameters

    • listStack: Node[]

      current stack of list elements

    • Optional originalRoot: HTMLUListElement | HTMLOListElement

      Original list root element. It will be reused when write back if possible

    • shouldReuseAllAncestorListElements: boolean = false

      Optional - defaults to false. If true, only make sure the direct parent of this list matches the list types when writing back.

    Returns void

Generated using TypeDoc