Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
html-custom-elements
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JadeProListening
html-custom-elements
Commits
edc20127
Commit
edc20127
authored
Sep 21, 2016
by
Stephanus Volke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change documentation of html-custom-element.js
parent
a446126e
Pipeline
#705
failed with stage
in 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
html-custom-element.js
src/html-custom-element.js
+10
-11
No files found.
src/html-custom-element.js
View file @
edc20127
...
...
@@ -5,22 +5,21 @@
* @license MIT
*/
/**
* Class extending the native HTMLElement. To reduce redundant code it
* provides methods often used while creating custom elements. If
* possible your own custom elements should inherit from this class.
*/
export
class
HTMLCustomElement
extends
HTMLElement
{
/**
* This interface class extends the native `HTMLElement` interface and
* provides some additional, often used methods.
*/
constructor
()
{
super
();
this
.
_observers
=
[];
}
/**
* This method is an extension of the nativ getElementById() JS
* function but works asynchroneous.
* equivalent of native getElementById, but works asynchroneous and
* returns a Promise which resolves when the requested element is
* aviable.
*
* @param {string} id - id of DOM element waiting for
* @return {Promise<Node>} - A Promise to the requested Element
...
...
@@ -40,9 +39,9 @@ export class HTMLCustomElement extends HTMLElement {
}
/**
*
This method offers an easy way to bind a mutationObserver to
an
* element
. Every time an attribute of Node changes, function fn
*
gets call
ed.
*
Like an event listener but for attributes. It observes
an
* element
s attribute for changes and invokes a pre defined callback
*
function. For this native js MutationObservers are us
ed.
*
* @param {HTMLNode} Node - reference to the HTML Node
* @param {string} Attr - attribute name to observe
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment