From f33a5df8988773a1ffb2588fc6e91b8a8bc7cfb4 Mon Sep 17 00:00:00 2001 From: Tomek Wytrebowicz Date: Fri, 6 Oct 2017 13:05:03 +0200 Subject: [PATCH 1/2] Dispatch `stamped` event as Juicy/juicy-html does --- README.md | 1 + imported-template.html | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 2e4e78d..e543c75 100644 --- a/README.md +++ b/README.md @@ -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 `stamping` | *DocumentFragment* fragment being stamped | Called just before stamping the fragment ### Dependencies diff --git a/imported-template.html b/imported-template.html index 1468823..95271a7 100644 --- a/imported-template.html +++ b/imported-template.html @@ -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; }; From 80eaeec96d8c2ca8df9f5f0f5489285883264a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Wytr=C4=99bowicz?= Date: Wed, 29 Nov 2017 09:57:16 +0100 Subject: [PATCH 2/2] Clarify Events table in README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e543c75..6f86c71 100644 --- a/README.md +++ b/README.md @@ -112,10 +112,10 @@ To provide a state before element is upgraded, please use attributes. ## Events -Name | Detail | Description ---- | --- | --- -`stamped` | *Array* of *Node* s array of stamped nodes | Trigger every time content is (re-)stamped -`stamping` | *DocumentFragment* fragment being stamped | Called just before stamping the fragment +Name | When | `event.detail` +--- | --- | --- +`stamped` | Every time content is (re-)stamped | *Array* of stamped *Node* s +`stamping` | Just before stamping the fragment | *DocumentFragment* being stamped ### Dependencies