API Docs for:
Show:

CharmConfigurationView Class

Module: views.charm-panel
Parent Module: views

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.

Methods

_calculateTooltipX

(
  • fieldX
  • tooltipWidth
)
Number static

Determine the X coordinate that would place a tooltip next to a field.

Parameters:

  • fieldX Number

    The current X position of the tooltip.

  • tooltipWidth Number

    The width of the tooltip.

Returns:

Number: New X coordinate for the tooltip.

_calculateTooltipY

(
  • fieldY
  • fieldHeight
  • tooltipHeight
)
Number static

Determine the Y coordinate that would center a tooltip on a field.

Parameters:

  • fieldY Number

    The current Y position of the tooltip.

  • fieldHeight Number

    The hight of the field.

  • tooltipHeight Number

    The height of the tooltip.

Returns:

Number: New Y coordinate for the tooltip.

_clearGhostService

(
  • ev
)
Undefined

Clears the ghost service from the database and updates the canvas.

Parameters:

  • ev Object

    An event object.

Returns:

Undefined: Side effects only.

_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:

Undefined: Mutates only.

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
)
Undefined

Fires an event indicating that the charm panel should switch to the "charms" search result view. Called upon clicking the "Cancel" button.

Parameters:

  • ev Object

    An event object (with a "halt" method).

Returns:

Undefined: Sends a signal only.

hide

() Undefined

Hide the charm panel. Set isPanelVisible to false.

Returns:

Undefined: Mutates only.

hideDescription

()

Hide the charm's description.

onCharmDeployClicked

(
  • ev
)
Undefined

Called upon clicking the "Confirm" button.

Parameters:

  • ev Object

    An event object (with a "halt" method).

Returns:

Undefined: Sends a signal only.

onFileChange

(
  • evt
)
Undefined

Handle the file upload click event. Call onFileLoaded or onFileError if an error occurs during upload.

Parameters:

  • evt Object

    An event object.

Returns:

Undefined: Mutates only.

onFileError

(
  • evt
)
Undefined

Callback called when an error occurs during file upload. Hide the charm configuration section.

Parameters:

  • evt Object

    An event object (with a "target.error" attr).

Returns:

Undefined: Mutates only.

onFileLoaded

(
  • evt
)
Undefined

Callback called when a file is correctly uploaded. Hide the charm configuration section.

Parameters:

  • evt Object

    An event object.

Returns:

Undefined: Mutates only.

onFileRemove

() Undefined

Handle the file remove click event. Restore the file upload widget on click.

Returns:

Undefined: Mutates only.

onOverlayClick

(
  • evt
)
Undefined

Pass clicks on the overlay on to the correct recipient. The recipient can be the upload widget or the file remove one.

Parameters:

  • evt Object

    An event object.

Returns:

Undefined: Dispatches only.

setDefaultSeries

()

Set the default charm series in the search and description panels.

setPanel

()

Setup the panel data.

setupOverlay

(
  • container
)
Undefined

Setup the panel overlay.

Parameters:

  • container Object

    The container element.

Returns:

Undefined: Side effects only.

show

() Undefined

Show the charm panel. Set isPanelVisible to true.

Returns:

Undefined: Mutates only.

showDescription

()

Show the charm's description.

toggle

(
  • ev
)
Undefined

Show the charm panel if it is hidden, hide it otherwise.

Parameters:

  • ev Object

    An event object (with a "halt" method).

Returns:

Undefined: Dispatches only.

updateGhostServiceName

(
  • evt
)
Undefined

Updates the ghost service's ID to reflect the service-name field.

Parameters:

  • evt Object

    The event that's fired.

Returns:

Undefined: Side effects only.

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.