CharmConfigurationView Class
Display a charm's configuration panel. It shows editable fields for the charm's configuration parameters, together with a "Cancel" and a "Confirm" button for deployment.
Item Index
Methods
- _calculateTooltipX static
- _calculateTooltipY static
- _clearGhostService
- _moveTooltip
- _setScroll
- calculatePanelPosition
- CharmConfigurationView.initializer
- CharmConfigurationView.render
- createInstance
- getInstance
- getInstance
- goBack
- hide
- hideDescription
- onCharmDeployClicked
- onFileChange
- onFileError
- onFileLoaded
- onFileRemove
- onOverlayClick
- setDefaultSeries
- setPanel
- setupOverlay
- show
- showDescription
- toggle
- updateGhostServiceName
- updatePanelPosition
Methods
_calculateTooltipX
-
fieldX -
tooltipWidth
Determine the X coordinate that would place a tooltip next to a field.
Parameters:
-
fieldXNumberThe current X position of the tooltip.
-
tooltipWidthNumberThe width of the tooltip.
Returns:
_calculateTooltipY
-
fieldY -
fieldHeight -
tooltipHeight
Determine the Y coordinate that would center a tooltip on a field.
Parameters:
-
fieldYNumberThe current Y position of the tooltip.
-
fieldHeightNumberThe hight of the field.
-
tooltipHeightNumberThe height of the tooltip.
Returns:
_clearGhostService
-
ev
Clears the ghost service from the database and updates the canvas.
Parameters:
-
evObjectAn event object.
Returns:
_moveTooltip
()
Move a tooltip to its predefined position.
_setScroll
()
Undefined
protected
When the view's "height" attribute is set, adjust the internal scrollable div to have the appropriate height.
Returns:
calculatePanelPosition
()
Calculate the panel position.
CharmConfigurationView.initializer
()
CharmConfigurationView.render
()
createInstance
()
Create the "_instance" object.
getInstance
()
Destroy the instance and its node, detaching all subscriptions.
getInstance
()
Get the instance, creating it if it does not yet exist.
goBack
-
ev
Fires an event indicating that the charm panel should switch to the "charms" search result view. Called upon clicking the "Cancel" button.
Parameters:
-
evObjectAn event object (with a "halt" method).
Returns:
hide
()
Undefined
Hide the charm panel. Set isPanelVisible to false.
Returns:
hideDescription
()
Hide the charm's description.
onCharmDeployClicked
-
ev
Called upon clicking the "Confirm" button.
Parameters:
-
evObjectAn event object (with a "halt" method).
Returns:
onFileChange
-
evt
Handle the file upload click event. Call onFileLoaded or onFileError if an error occurs during upload.
Parameters:
-
evtObjectAn event object.
Returns:
onFileError
-
evt
Callback called when an error occurs during file upload. Hide the charm configuration section.
Parameters:
-
evtObjectAn event object (with a "target.error" attr).
Returns:
onFileLoaded
-
evt
Callback called when a file is correctly uploaded. Hide the charm configuration section.
Parameters:
-
evtObjectAn event object.
Returns:
onFileRemove
()
Undefined
Handle the file remove click event. Restore the file upload widget on click.
Returns:
onOverlayClick
-
evt
Pass clicks on the overlay on to the correct recipient. The recipient can be the upload widget or the file remove one.
Parameters:
-
evtObjectAn event object.
Returns:
setDefaultSeries
()
Set the default charm series in the search and description panels.
setPanel
()
Setup the panel data.
setupOverlay
-
container
Setup the panel overlay.
Parameters:
-
containerObjectThe container element.
Returns:
show
()
Undefined
Show the charm panel. Set isPanelVisible to true.
Returns:
showDescription
()
Show the charm's description.
toggle
-
ev
Show the charm panel if it is hidden, hide it otherwise.
Parameters:
-
evObjectAn event object (with a "halt" method).
Returns:
updateGhostServiceName
-
evt
Updates the ghost service's ID to reflect the service-name field.
Parameters:
-
evtObjectThe event that's fired.
Returns:
updatePanelPosition
()
Update the panel position.
This should only be called when the popup is supposed to be visible. We need to hide the popup before we calculate positions, so that it does not cause scrollbars to appear while we are calculating positions. The temporary scrollbars can cause the calculations to be incorrect.
