Namespace: helpers

Granite.author.ui. helpers

Contains convenience functions to generate UI elements

Idea is to provide convenience "intention-based" functions to generate commonly-used UI elements
and hide their implementation details (markup).

Source:
ui/ui.helpers.js

Members


<static, readonly> self.NOTIFICATION_TYPES :string

Type of available notification style

Type:
  • string
Properties:
Name Type Default Description
ERROR string error

Error notification.

NOTICE string notice

Notice notification.

SUCCESS string success

Success notification.

HELP string help

Help notification.

INFO string info

Info notification.

Source:
ui/ui.helpers.js

<static, readonly> self.PROMPT_TYPES :string

Type of available prompt style

Type:
  • string
Properties:
Name Type Default Description
DEFAULT string default

Default prompt

ERROR string error

Error prompt

NOTICE string notice

Notice prompt

SUCCESS string success

Success prompt

HELP string help

Help prompt

INFO string info

Info prompt

Source:
ui/ui.helpers.js

Methods


<static> notify(config)

Notifies the user

Parameters:
Name Type Description
config Object

Configuration for the notification

Properties
Name Type Description
heading String

Heading of the notification

content String

Content of the notification

type String

One of the avaialbe types of notification

closable Boolean

Can the notification be closed

className String

Additional stylesheet class names to be added to the notification element

Source:
ui/ui.helpers.js

<static> prompt(config)

Prompts a modal to the user

Parameters:
Name Type Description
config Object

Configuration of the prompt

Properties
Name Type Argument Description
title String

Title of the modal

message String

Message, Content of the modal

actions Array.<Object>

The actions available to the user

Properties
Name Type Argument Default Description
id String

The id of this action

text String

The text of this action

className String

Additional classes for the action element

primary Boolean <optional>
false

true to make this action as the primary action

callback function <optional>

The callback function. The action.id will be passed as a parameter of that callback

Source:
ui/ui.helpers.js