Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Brique

Class representing a Brique.

Hierarchy

  • Brique

Index

Constructors

constructor

  • new Brique(gridElement: HTMLElement, options?: BriqueOptions, observeGridResize?: boolean): Brique
  • Creates a new instance of Brique.

    Parameters

    • gridElement: HTMLElement

      Grid container

    • options: BriqueOptions = Brique.DEFAULT_OPTIONS

      Options to customize the grid

    • observeGridResize: boolean = true

      Update the dimension of grid items when the grid container is resized

    Returns Brique

Properties

Private childrenObserver

childrenObserver: MutationObserver

Readonly gridElement

gridElement: HTMLElement

Optional itemElements

itemElements?: HTMLElement[]

Private observeGridResize

observeGridResize: boolean

Private options

options: BriqueOptions

Private resizeEvent

resizeEvent: () => void

Type declaration

    • (): void
    • Returns void

Private resizeObserver

resizeObserver: ResizeObserver

Static DEFAULT_OPTIONS

DEFAULT_OPTIONS: BriqueOptions = ...

Methods

destroy

  • destroy(): void
  • Removes all events listened to on the HTML elements handled by the Brique class. The destroy() method must be called when the grid is removed from HTML.

    Returns void

Private draw

  • draw(): void
  • Apply inline styles on grid container and grid items

    Returns void

Private drawGridContainer

  • drawGridContainer(): void
  • Apply inline styles on grid container

    Returns void

Private drawItems

  • drawItems(): void
  • Apply inline styles on grid items

    Returns void

getOptions

Private setItemElements

  • setItemElements(): void
  • Find grid items in grid element children and set property itemElements

    Returns void

setOptions

stopUpdateOnResize

  • stopUpdateOnResize(): void
  • Update the dimension of grid items when the grid element is resized.

    Returns void

update

  • update(): void
  • Update the rendering of the entire grid.

    Returns void

updateItems

  • updateItems(): void
  • Update the rendering of the grid items.

    Returns void

updateOnResize

  • updateOnResize(): void
  • Update the dimension of grid items when the grid element is resized.

    Returns void

updateOptions

  • Updates only changed properties.

    Parameters

    Returns void

Generated using TypeDoc