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
trueor after Document#event:cq-editor-statusbar-loaded has been fired.Parameters:
Name Type Argument Default Description typestring the status type
titlestring the status title describing the module or feature the status is associated with
messagestring the status message
shortMessagestring <optional>
a short message to be displayed in the popover list
prioritynumber <optional>
the status priority (if omitted, a default is assumed based on the variant)
variantstring <optional>
info the status variant, in line with Coral.Alert variants ('success', 'info', 'warning' or 'error')
iconstring <optional>
the name of a CoralUI icon (if omitted, a default is assumed based on the variant)
dataObject <optional>
additional data to be associated with this status (e.g. to implement an action)
actionsArray.<Object> <optional>
actions to act upon the status
actions[].idstring the id of the action
actions[].labelstring 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:
trueif the statuses have been loaded,falseotherwise- 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 pathstring 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 idnumber 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 idnumber the status id
- Source:
- ui/ui.StatusBar.js