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 textString Text to highlight. escapeBoolean <optional>
true If true, Handlebars.Utils.escapeExpressionwill be applied to thetextbefore 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 textString Text to highlight. fragmentString highlighted fragment. escapeBoolean <optional>
true If true, Handlebars.Utils.escapeExpressionwill be applied to thetextbefore 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 textString Text to highlight. escapeBoolean <optional>
true If true, Handlebars.Utils.escapeExpressionwill be applied on to thetextbefore highlighting.Returns:
Highlighted text- Type
- String
-
<static> isElementInDom(el)
-
Checks if element is presented in visible DOM.
Parameters:
Name Type Description elObject DOM-element to check. Returns:
True if an element is presented in DOM.- Type
- Boolean