Home Reference Source Repository
import MinimapElement from 'minimap/lib/minimap-element.js'
public class | source

MinimapElement

Public: The MinimapElement is the view meant to render a Minimap instance in the DOM.

You can retrieve the MinimapElement associated to a Minimap using the atom.views.getView method.

Note that most interactions with the Minimap package is done through the Minimap model so you should never have to access MinimapElement instances.

Example:

let minimapElement = atom.views.getView(minimap)

Static Method Summary

Static Public Methods
public static

The method that registers the MinimapElement factory in the atom.views registry with the Minimap model.

Method Summary

Public Methods
public

attach(parent: HTMLElement)

Attaches the MinimapElement to the DOM.

public

Destroys this MinimapElement

public

detach()

Detaches the MinimapElement from the DOM.

public

Returns the Minimap for which this MinimapElement was created.

public

getTextEditor(): TextEditor

Returns the target TextEditor of the Minimap.

public

getTextEditorElement(): TextEditorElement

Returns the TextEditorElement for the Minimap's TextEditor.

public

getTextEditorElementRoot(): HTMLElement

Returns the root of the TextEditorElement content.

public

Returns whether the MinimapElement is currently visible on screen or not.

public

Requests an update to be performed on the next frame that will completely redraw the minimap.

public

Requests an update to be performed on the next frame.

public

setDisplayCodeHighlights(displayCodeHighlights: Boolean)

Defines whether to render the code highlights or not.

public

setModel(minimap: Minimap): Minimap

Defines the Minimap model for this MinimapElement instance.

public

setStandAlone(standAlone: boolean)

Sets the stand-alone mode for this MinimapElement.

Static Public Methods

public static registerViewProvider() source

The method that registers the MinimapElement factory in the atom.views registry with the Minimap model.

Public Methods

public attach(parent: HTMLElement) source

Attaches the MinimapElement to the DOM.

The position at which the element is attached is defined by the displayMinimapOnLeft setting.

Params:

NameTypeAttributeDescription
parent HTMLElement
  • optional

the DOM node where attaching the minimap element

public destroy() source

Destroys this MinimapElement

public detach() source

Detaches the MinimapElement from the DOM.

public getModel(): Minimap source

Returns the Minimap for which this MinimapElement was created.

Return:

Minimap

this element's Minimap

public getTextEditor(): TextEditor source

Returns the target TextEditor of the Minimap.

Return:

TextEditor

the minimap's text editor

public getTextEditorElement(): TextEditorElement source

Returns the TextEditorElement for the Minimap's TextEditor.

Return:

TextEditorElement

the minimap's text editor element

public getTextEditorElementRoot(): HTMLElement source

Returns the root of the TextEditorElement content.

This method is mostly used to ensure compatibility with the shadowDom setting.

Return:

HTMLElement

the root of the TextEditorElement content

public isVisible(): boolean source

Returns whether the MinimapElement is currently visible on screen or not.

The visibility of the minimap is defined by testing the size of the offset width and height of the element.

Return:

boolean

whether the MinimapElement is currently visible or not

public requestForcedUpdate() source

Requests an update to be performed on the next frame that will completely redraw the minimap.

public requestUpdate() source

Requests an update to be performed on the next frame.

public setDisplayCodeHighlights(displayCodeHighlights: Boolean) source

Defines whether to render the code highlights or not.

Params:

NameTypeAttributeDescription
displayCodeHighlights Boolean

whether to render the code highlights or not

public setModel(minimap: Minimap): Minimap source

Defines the Minimap model for this MinimapElement instance.

Params:

NameTypeAttributeDescription
minimap Minimap

the Minimap model for this instance.

Return:

Minimap

this element's Minimap

public setStandAlone(standAlone: boolean) source

Sets the stand-alone mode for this MinimapElement.

Params:

NameTypeAttributeDescription
standAlone boolean

the new mode for this MinimapElement