Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
thesoftwarephilosopher committed Aug 17, 2024
1 parent 0dc4896 commit 229c2c3
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions site/samples/sample5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,19 @@ class List {

class Item {

public done = false;
private checkbox = <input type='checkbox' /> as HTMLInputElement;
done = false;
#checkbox = <input type='checkbox' /> as HTMLInputElement;
li;

constructor(
private list: List,
public text: string,
public li = (
constructor(private list: List, public text: string) {
this.li = (
<li class='item'>
{this.checkbox}
{this.#checkbox}
<span onclick={() => this.toggle()}>{text}</span>
<button class='close' onclick={() => this.remove()}></button>
</li> as HTMLLIElement
),
) {
this.checkbox.onclick = () => this.toggle();
);
this.#checkbox.onclick = () => this.toggle();
}

remove() {
Expand All @@ -93,7 +91,7 @@ class Item {
toggle() {
this.done = !this.done;
this.li.classList.toggle('done', this.done);
this.checkbox.checked = this.done;
this.#checkbox.checked = this.done;
this.list.itemChanged();
}

Expand Down

0 comments on commit 229c2c3

Please sign in to comment.