Skip to content

Latest commit

 

History

History
114 lines (80 loc) · 3.93 KB

File metadata and controls

114 lines (80 loc) · 3.93 KB

Import :

const PluginPanelView = brackets.getModule("view/PluginPanelView")

Panel

Kind: global class

new Panel($panel, id, $toolbarIcon, [minWidth], [initialSize])

Represents a panel below the editor area (a child of ".content").

Param Type Description
$panel jQueryObject The entire panel, including any chrome, already in the DOM.
id string Unique id for this panel. Use package-style naming, e.g. "myextension.panelname". will overwrite an existing panel id if present.
$toolbarIcon jQueryObject An icon that should be present in main-toolbar to associate this panel to. The panel will be shown only if the icon is visible on the toolbar and the user clicks on the icon.
[minWidth] number Minimum width of panel in px.
[initialSize] number Optional Initial size of panel in px. If not given, panel will use minsize or current size.

panel.$panel : jQueryObject

Dom node holding the rendered panel

Kind: instance property of Panel

panel.isVisible() ⇒ boolean

Determines if the panel is visible

Kind: instance method of Panel
Returns: boolean - true if visible, false if not

panel.registerCanBeShownHandler(canShowHandlerFn) ⇒ boolean

Registers a call back function that will be called just before panel is shown. The handler should return true if the panel can be shown, else return false and the panel will not be shown.

Kind: instance method of Panel
Returns: boolean - true if visible, false if not

Param Type Description
canShowHandlerFn function | null function that should return true of false if the panel can be shown/not. or null to clear the handler.

panel.canBeShown() ⇒ boolean

Returns true if th panel can be shown, else false.

Kind: instance method of Panel

panel.show()

Shows the panel

Kind: instance method of Panel

panel.hide()

Hides the panel

Kind: instance method of Panel

panel.setVisible(visible)

Sets the panel's visibility state

Kind: instance method of Panel

Param Type Description
visible boolean true to show, false to hide

panel.getPanelType() ⇒ string

gets the Panel's type

Kind: instance method of Panel

EVENT_PANEL_HIDDEN : string

Event when panel is hidden

Kind: global constant

EVENT_PANEL_SHOWN : string

Event when panel is shown

Kind: global constant

PANEL_TYPE_PLUGIN_PANEL : string

type for plugin panel

Kind: global constant