Options
All
  • Public
  • Public/Protected
  • All
Menu

The object with functionality related to the browser environment, such as information about the current browser.

Index

Variables

browser: string

The current browser type.

ios: boolean

true if the current browser is an IOS browser, false otherwise.

mobile: boolean

true if the current browser is a mobile browser, false otherwise.

preferredColorSchemeDark: boolean

true if the user's current OS setting prefers dark mode, false otherwise.

preferredColorSchemeLight: boolean

true if the user's current OS setting prefers light mode, false otherwise.

touch: boolean

true if the current browser supports touch, false otherwise.

Functions

  • evaluateMediaQuery(mediaquery: string): boolean
  • Evaluate a media query and return true/false if its a match.

    Parameters

    • mediaquery: string

      the media query to evaluate

    Returns boolean

    true if it matches the query false if not

  • getOSPreferredColorScheme(): string
  • Gets the user's preferred color scheme set in their operating system.

    Returns string

    either 'dark' or 'light'

  • getTheme(): string
  • Gets the currently loaded PrimeFaces theme.

    Returns string

    The current theme, such as omega or luna-amber. Empty string when no theme is loaded.

  • getThemeContrast(): string
  • Based on the current PrimeFaces theme determine if light or dark contrast is being applied.

    Returns string

    either 'dark' or 'light'

  • init(): void
  • Initializes the environment by reading the browser environment.

    Returns void

  • isScreenSizeGreaterThan(pixels: number): boolean
  • Media query to determine if screen size is above pixel count.

    Parameters

    • pixels: number

      the number of pixels to check

    Returns boolean

    true if screen is greater than number of pixels

  • isScreenSizeLessThan(pixels: number): boolean
  • Media query to determine if screen size is below pixel count.

    Parameters

    • pixels: number

      the number of pixels to check

    Returns boolean

    true if screen is less than number of pixels

  • A widget is touch enabled if the browser supports touch AND the widget has the touchable property enabled. The default will be true if it widget status can't be determined.

    Parameters

    Returns boolean

    true if touch is enabled, false if disabled

Generated using TypeDoc