new StatusBar()
Creates a StatusBar instance.
- Source:
- ui/ui.StatusBar.js
Members
-
loaded
-
Flag indicating if the statuses of the current resource have already been loaded.
- Source:
- ui/ui.StatusBar.js
Methods
-
addStatus(type, title, message [, shortMessage] [, priority] [, variant] [, icon] [, data] [, actions])
-
Adds a new status to the status bar. The status will be inserted into the list of existing statuses according to its priority. The status bar will be made visible if it is hidden.
This method must only be called after the statuses of the current resource have been loaded, i.e. when Granite.author.ui.StatusBar#hasLoaded returns
true
or after Document#event:cq-editor-statusbar-loaded has been fired.Parameters:
Name Type Argument Default Description type
string the status type
title
string the status title describing the module or feature the status is associated with
message
string the status message
shortMessage
string <optional>
a short message to be displayed in the popover list
priority
number <optional>
the status priority (if omitted, a default is assumed based on the variant)
variant
string <optional>
info the status variant, in line with Coral.Alert variants ('success', 'info', 'warning' or 'error')
icon
string <optional>
the name of a CoralUI icon (if omitted, a default is assumed based on the variant)
data
Object <optional>
additional data to be associated with this status (e.g. to implement an action)
actions
Array.<Object> <optional>
actions to act upon the status
actions[].id
string the id of the action
actions[].label
string the label of the action
- Source:
- ui/ui.StatusBar.js
Returns:
the status id
- Type
- number
-
hasLoaded()
-
Checks if the statuses of the current resource have already been loaded.
- Source:
- ui/ui.StatusBar.js
Returns:
true
if the statuses have been loaded,false
otherwise- Type
- boolean
-
hide()
-
Hides the status bar.
- Source:
- ui/ui.StatusBar.js
-
loadStatuses(path)
-
Retrieves the statuses for a given resource and adds them to the status bar. Current statuses are reset and the status bar will be shown if it is hidden.
Parameters:
Name Type Description path
string the path to a resource for which to load the statuses
- Source:
- ui/ui.StatusBar.js
Fires:
-
removeStatus(id)
-
Removes the status with the specified id from the status bar. The status bar will be hidden if no more statuses are present after the removal.
Parameters:
Name Type Description id
number the id of the status to remove
- Source:
- ui/ui.StatusBar.js
-
show()
-
Shows the status bar.
- Source:
- ui/ui.StatusBar.js
-
showNextStatus()
-
Shows the status next to the one currently displayed (having equal or lower priority).
- Source:
- ui/ui.StatusBar.js
-
showPreviousStatus()
-
Shows the status previous to the one currently displayed (having equal or higher priority).
- Source:
- ui/ui.StatusBar.js
-
showStatus(id)
-
Shows the status with the specified id. The status bar will be made visible if it is hidden.
Parameters:
Name Type Description id
number the status id
- Source:
- ui/ui.StatusBar.js