Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Fold

Hierarchy

  • Fold

Implements

Index

Constructors

constructor

Properties

Private folderNodes

folderNodes: JQuery[]

List of folder nodes. The list must be emptied and recomputed each time the style is applied.

name

name: string = "Fold"

Static FOLDABLE_ELEMENT_CLASS

FOLDABLE_ELEMENT_CLASS: string = "sam-foldable"

HTML class of a foldable element (contained by a folder).

Static FOLDER_ELEMENT_CLASS

FOLDER_ELEMENT_CLASS: string = "sam-folder"

HTML class of a folder element.

Static IS_FOLDED_CLASS

IS_FOLDED_CLASS: string = "sam-folded"

HTML class of a folded folder element (containing hidden items).

Static SWITCH_FOLD_BUTTON_CLASS

SWITCH_FOLD_BUTTON_CLASS: string = "sam-fold-button"

HTML class of a folder switch button (to open/close the folder).

Methods

apply

Private applyInGroup

  • applyInGroup(sameGroupItems: Item[]): void
  • Fold a certain subset of the given items, assuming they all belong to the same group.

    The subset excludes a certain number of leading items in the given list, given by getMaxNbItemsToDisplayInGroup. Those items are left displayed above/before the folder, which contain all the remaining items (in their original order).

    Parameters

    • sameGroupItems: Item[]

      The sorted list of items located in the same group.

    Returns void

cancel

  • cancel(): void

Private createAndAppendFoldButtonToFolder

  • createAndAppendFoldButtonToFolder(folderNode: JQuery): void
  • Create and append a folder switch button to the given folder node.

    Parameters

    • folderNode: JQuery

      The folder node to add the switch button to.

    Returns void

Private createSwitchFoldButton

  • createSwitchFoldButton(folderNode: JQuery): JQuery
  • Create and return a folder switch button, for the given folder node.

    Parameters

    • folderNode: JQuery

      The folder node the button should fold and unfold.

    Returns JQuery

    The new button node.

Private fold

  • fold(folderNode: JQuery): void
  • Fold the folder represented by the given node.

    Parameters

    • folderNode: JQuery

      The folder node to fold.

    Returns void

Private getMaxNbItemsToDisplayInGroup

  • getMaxNbItemsToDisplayInGroup(nbItemsInGroup: number): number
  • Return the maximum number of items which must be kept visible in a group, i.e. which will not be put into a folder.

    Parameters

    • nbItemsInGroup: number

    Returns number

    The maximum number of items to keep displayed in the group.

Private makeFolder

  • makeFolder(items: Item[]): void
  • Group the given items under a new folder, by moving them to a new container, and adding a button to switch the folder state.

    Note: new folders are folded by default (its content is hidden).

    Parameters

    • items: Item[]

      The list of items to group under a single new folder.

    Returns void

Private splitAndApplyByGroup

  • splitAndApplyByGroup(items: Item[]): void

Private switchFoldState

  • switchFoldState(folderNode: JQuery): void
  • Switch whether the folder represented by the given node is folded or unfolded.

    Parameters

    • folderNode: JQuery

      The folder node to fold or unfold.

    Returns void

Private unfold

  • unfold(folderNode: JQuery): void
  • Unfold the folder represented by the given node.

    Parameters

    • folderNode: JQuery

      The folder node to unfold.

    Returns void

Generated using TypeDoc