Class: View

View

new View(container, templates, options)

Parameters:
Name Type Description
container HTMLElement
templates Object a set of templates into which we render munged data
options Object
Source:

Methods

<private> _findMentionContainerNode(range) → {Node|null}

Return the DOM node that encloses the line on which current mention is being typed.
Parameters:
Name Type Description
range Range
Source:
Returns:
Type
Node | null

<private> _findMentionNode(range) → {Node|null}

Return the (hopefully inline-positioned) DOM node that encloses the mention itself.
Parameters:
Name Type Description
range Range
Source:
Returns:
Type
Node | null

<private> _findOffsetLines(range) → {Node[]}

Return an array of dom nodes corresponding to all lines at or before the line corresponding to the current range.
Parameters:
Name Type Description
range Range
Source:
Returns:
Type
Node[]

<private> _getTopMargin()

Source:

<private> _nodeHeight()

Source:

<private> _renderLI(datum)

Renders listItem template with a datum as the context
Parameters:
Name Type Description
datum object A piece of data
Source:

<private> _renderWithContext(template, o)

Renders a template given the context of an object
Parameters:
Name Type Description
template string
o object Context for a template string.
Source:

getMatches() → {HTMLElement[]}

Source:
Returns:
Type
HTMLElement[]

hasMatches() → {HTMLElement[]}

Source:
Returns:
Type
HTMLElement[]

hide(quill, range)

Makes the popover disappear
Parameters:
Name Type Description
quill Quill
range Object
Source:

isHidden() → {boolean}

Returns whether the popover is in view. I had bad feels about this method but it's coming in hand re: keyboard events right now.
Source:
Returns:
Type
boolean

render(data)

Creates view from data and calls View~_renderSuccess. If there are no data, calls View~_renderError.
Parameters:
Name Type Description
data array
Source:

show(quill)

Adds an active class to the mentions popover and sits it beneath the cursor. [TODO - add active class to config]
Parameters:
Name Type Description
quill Quill
Source: