Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ReorderGroups

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected childrenInOriginalOrder

childrenInOriginalOrder: Map<HTMLElement, JQuery>

Map from HTML parent elements to JQuery children nodes, in their original order. This is used to save the original element ordering.

name

name: string = "Reorder groups"

Static NON_REORDERABLE_ELEMENT_CLASS

NON_REORDERABLE_ELEMENT_CLASS: "sam-no-reordering" = "sam-no-reordering"

HTML class of items or groups whose nodes must not be reordered.

Such elements are flagged accordingly when they are created (see Item.canBeReordered and ItemGroup.canBeReordered).

Static REORDERED_ELEMENT_CLASS

REORDERED_ELEMENT_CLASS: string = "sam-reordered-group"

HTML class of group elements which have been reordered.

Methods

apply

cancel

  • cancel(): void

Private getFilteredSortedGroups

  • Use the given policy to score and sort the groups of all the menus to adapt, and filter out any group which:

    • cannot be reordered;
    • has a null (0) score.

    Parameters

    • menuManager: MenuManager

      The menu manager containing the menus with groups to reorder.

    • policy: TargetPolicy

      The policy to use to score the groups.

    • Optional dataManager: DataManager

      The data manager containing data for the policy.

    Returns ItemGroup[]

    A sorted and filtered list of groups.

Protected getReorderedElementClass

  • getReorderedElementClass(): string

Protected getReorderedElementType

  • getReorderedElementType(): string

Protected reorderAllElements

  • Reorder all given elements in the given order.

    Non-given elements may be moved to a higher index if need be, except for elements marked as non-reorderable.

    This method expects a complete list of menu adaptive elements, supposedly computed by a policy. It was designed to be called by implementations of AdaptationStyle.apply.

    Parameters

    Returns void

Protected saveParentNodeChildrenInOriginalOrder

Generated using TypeDoc