Namespace: htmlHelpers

module:core.utils. htmlHelpers

Useful methods to generate HTML and manipulate DOM-elements.

Methods


<static> forbidSelection()

Use CSS for the same effect. IE8 is not supported anymore.
Deprecated:
  • Yes

<static> getDocumentPosition()

Use jQuery .offset().
Deprecated:
  • Yes

<static> highlightMentions(text [, escape])

Highlights mentions within a text with <a href='...'></a>.
Parameters:
Name Type Argument Default Description
text String Text to highlight.
escape Boolean <optional>
true If true, Handlebars.Utils.escapeExpression will be applied to the text before highlighting.
Returns:
Highlighted text
Type
String

<static> highlightText(text, fragment [, escape])

Highlights fragments within a text with <span class='highlight'></span>.
Parameters:
Name Type Argument Default Description
text String Text to highlight.
fragment String highlighted fragment.
escape Boolean <optional>
true If true, Handlebars.Utils.escapeExpression will be applied to the text before highlighting.
Returns:
Highlighted text
Type
String

<static> highlightUrls(text [, escape])

Highlights urls within a text with <a href='...'></a>.
Parameters:
Name Type Argument Default Description
text String Text to highlight.
escape Boolean <optional>
true If true, Handlebars.Utils.escapeExpression will be applied on to the text before highlighting.
Returns:
Highlighted text
Type
String

<static> isElementInDom(el)

Checks if element is presented in visible DOM.
Parameters:
Name Type Description
el Object DOM-element to check.
Returns:
True if an element is presented in DOM.
Type
Boolean