Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch stamped event as Juicy/juicy-html does #32

Merged
merged 2 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ To provide a state before element is upgraded, please use attributes.

Name | Detail | Description
--- | --- | ---
`stamped` | *Array* of *Node* s array of stamped nodes | Trigger every time content is (re-)stamped
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldnt' detail be *Array* of *Node* s like in juicy-html?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it. It is "Array of Nodes".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see some redundant text in that column. See the highlight on the below screenshot:

2017-10-09_12-09-03

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah! So you want to remove "array of stamped nodes"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, or move the description of the detail to the description column

Copy link
Member Author

@tomalec tomalec Nov 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it a second thought, I would say we need two descriptions: one to describe when the event is fired, another to describe the detail contents.

What about:

Name Detail When
stamped Array of stamped Node s Every time content is (re-)stamped

or

Name When Detail
stamped Every time content is (re-)stamped Array(Node) - stamped nodes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

80eaeec looks good to me

`stamping` | *DocumentFragment* fragment being stamped | Called just before stamping the fragment

### Dependencies
Expand Down
3 changes: 3 additions & 0 deletions imported-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@
// TODO(tomalec): check if it's still required
setTimeout(function appendAsync() {
document.head.appendChild(link);
that.dispatchEvent(new CustomEvent("stamped", {
detail: that.stampedNodes
}));
});
return this;
};
Expand Down