This module appends the icons to the document body. If this module is initialized twice, the icons are not appended since they only need to be appended once.
Members
(inner) moduleApi
Properties:
Name | Type | Description |
---|---|---|
destroy |
function |
Destroys the module. |
Methods
init() → {module:svg-icons~moduleApi}
Initializes the module. This method will insert the SVG icon sprite into the body of the page. This sprite can be shared between multiple instances of the viewer embedded on the same page.
Returns:
The module API object.
parseIcons(dom)
Parses icons. For any HTML template that contains icons, this method must be called with the HTML template passed as the parameter. Note that the init method must be called before calling parseIcons
.
Parameters:
Name | Type | Description |
---|---|---|
dom |
HTMLElement |
A parent DOM element, or jQuery-wrapped element, that contains the icons that need to be parsed. |
(inner) module:svg-icons#updateIcon Parses a single icon.(elem)
Parameters:
Name | Type | Description |
---|---|---|
elem |
HTMLElement |
The icon that needs to be parsed. |