HintBox

HintBox

This component takes care of the display of hint boxes in the application Component is used from https://www.npmjs.com/package/clulib

Constructor

new HintBox()

Source:

Extends

  • Component

Members

(private) closeButtons_ :NodeList

Description:
  • Dom element for the close button

Source:

Dom element for the close button

Type:
  • NodeList

(private) completer_ :Completer

Description:
  • Completer is a helper which returns a promise. Its solved if open hint box is closed.

Source:

Completer is a helper which returns a promise. Its solved if open hint box is closed.

Type:
  • Completer

(private) contents_ :NodeList

Description:
  • List of hint box contents defined by the class .hint-box-content and the attribute data-content=type

Source:

List of hint box contents defined by the class .hint-box-content and the attribute data-content=type

Type:
  • NodeList

(private) currentContentType_ :string

Description:
Source:

Active hint box type. Use HintBoxContentType.

Type:
  • string

isVisible

Description:
  • Getter

Source:

Getter

(private) isVisible_ :boolean

Description:
  • Defines if the hint box is currently displayed

Source:

Defines if the hint box is currently displayed

Type:
  • boolean

(private) shownContentTypy_ :Array.<string>

Description:
  • List of all certain hint box content types which has already been displayed.

Source:

List of all certain hint box content types which has already been displayed.

Type:
  • Array.<string>

(private) visibleTimeout_ :number

Description:
  • Timeout id for the automatic disappearance

Source:

Timeout id for the automatic disappearance

Type:
  • number

Methods

contentWasShown(contentType) → {boolean}

Description:
  • Checked if a certain hint box content type has already been displayed.

Source:
Parameters:
Name Type Description
contentType string

Use HintBoxContentType

Returns:
Type
boolean

(private) handleCloseClick_()

Description:
  • Handle hint box close click

Source:

hide(contentTypeopt)

Description:
  • Hides the hint box and deactivates all interactive elements of the hint box content

Source:
Parameters:
Name Type Attributes Description
contentType string <optional>

Optional HintBoxContentType if the methode should only hide a specific type of hint box.

onInit()

Description:
  • Component is ready and had loaded all dependencies (inherit method waitFor and sub components).

Source:

show(contentType, duration) → {Promise}

Description:
  • Displays the hint box of a given type and activates all interactive elements of the hint box content The method returns a Promise that is resolved when the hint box is closed. The type is assigned by setting the attribute to the hint box content element in the dom app\viwes.index.php.

Source:
Example

HintBoxContentType `NAVIGATION_MOVEMENT`

<div class="hint-box-content" data-content="navigation-movement"> ...
Parameters:
Name Type Default Description
contentType string

Use HintBoxContentType

duration number 4
Returns:
Type
Promise