Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Add custom Janeway representation for HTML elements
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed Jun 15, 2024
1 parent d421f3f commit 99c135c
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion lib/dom/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,4 +914,35 @@ Element.setMethod(function matches(selector) {
// Some no-ops for browser compatibility
Element.setMethod(function addEventListener() {});
Element.setMethod(function removeEventListener() {});
Element.setMethod(function focus() {});
Element.setMethod(function focus() {});

/**
* Custom Janeway representation (left side)
*
* @author Jelle De Loecker <[email protected]>
* @since 2.4.0
* @version 2.4.0
*
* @return {string}
*/
Element.setMethod(Blast.JANEWAY_LEFT, function janewayClassIdentifier() {
return this.nodeName
});

/**
* Custom Janeway representation (right side)
*
* @author Jelle De Loecker <[email protected]>
* @since 2.4.0
* @version 2.4.0
*
* @return {string}
*/
Element.setMethod(Blast.JANEWAY_RIGHT, function janewayInstanceInfo() {

if (this.id) {
return '#' + this.id;
}

return '';
});

0 comments on commit 99c135c

Please sign in to comment.