Commit edc20127 authored by Stephanus Volke's avatar Stephanus Volke

change documentation of html-custom-element.js

parent a446126e
Pipeline #705 failed with stage
in 10 seconds
......@@ -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 called.
* Like an event listener but for attributes. It observes an
* elements attribute for changes and invokes a pre defined callback
* function. For this native js MutationObservers are used.
*
* @param {HTMLNode} Node - reference to the HTML Node
* @param {string} Attr - attribute name to observe
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment