Skip to content

Commit

Permalink
docs(addon/components/paper-item): adds documentation to focused, `…
Browse files Browse the repository at this point in the history
…didInsertNode`, `willDestroyNode`.
  • Loading branch information
matthewhartstonge committed Dec 30, 2024
1 parent 9b3fb5f commit d8e8c1e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion addon/components/paper-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ export default class PaperItem extends Component {
element;

/**
* Set of child grid tile components
* Array of child components.
* @type {A}
*/
@tracked children;
/**
* marks whether the component is focused. Sets class `md-focused` if true.
* @type {boolean}
*/
@tracked focused = false;

constructor(owner, args) {
Expand All @@ -35,6 +39,10 @@ export default class PaperItem extends Component {
}
}

/**
* Performs any required DOM setup.
* @param {HTMLElement} element
*/
@action didInsertNode(element) {
element.addEventListener('mouseenter', this.handleMouseEnter);
element.addEventListener('mouseleave', this.handleMouseLeave);
Expand All @@ -46,6 +54,10 @@ export default class PaperItem extends Component {
// noop
}

/**
* Performs any required DOM teardown.
* @param {HTMLElement} element
*/
@action willDestroyNode(element) {
element.removeEventListener('mouseenter', this.handleMouseEnter);
element.removeEventListener('mouseleave', this.handleMouseLeave);
Expand Down

0 comments on commit d8e8c1e

Please sign in to comment.