This commit is contained in:
Carson Gross 2020-05-09 16:52:48 -07:00
parent dff17f95cd
commit 0a7ff69ed6
3 changed files with 56 additions and 2 deletions

View File

@ -11,9 +11,9 @@ title: </> kutty - Attributes
| [kt-classes](/attributes/kt-classes) | timed modification of classes on an element
| [kt-confirm](/attributes/kt-confirm) | shows a confim() dialog before issuing a request
| [kt-delete](/attributes/kt-delete) | issue a `DELETE` to the specified URL
| kt-error-url | TODO - Description
| [kt-error-url](/attributes/kt-error-url) | a URL to send client-side errors to
| [kt-get](/attributes/kt-get) | issue a `GET` to the specified URL
| kt-history-elt | TODO - Description
| [kt-history-elt](/attributes/kt-history-elt) | the element to use for history snap-shotting & restoration
| kt-include | TODO - Description
| kt-indicator | TODO - Description
| [kt-patch](/attributes/kt-patch) | TODO - Description

View File

@ -0,0 +1,23 @@
---
layout: layout.njk
title: </> kutty - kt-error-url
---
## `kt-error-url`
The `kt-error-url` attribute allows you to send client-side errors to a specified URL. It is typically put on the
body tag, so all errors are caught and send to the server.
```html
<body kt-error-url="/errors">\
</body>
```
When a client side error is caught by kutty it will be `POST`-ed to the given URL, with the following JSON format:
```json
{ "elt": elt.id, "event": eventName, "detail" : detail }
```
### Notes

View File

@ -0,0 +1,31 @@
---
layout: layout.njk
title: </> kutty - kt-history-elt
---
## `kt-history-elt`
The `kt-history-elt` attribute allows you to specify an element as the place
where [history support](/docs#history) will capture HTML from and restore it to
during history navigation.
By default the `body` tag is used but you may want to narrow this to a child
element. Be careful if you do, however: the element must be present on all pages
in your application or a history navigation may fail.
Here is an example:
```html
<body>
<div class="menu">...</div>
<div class="content" kt-history-elt="true">
...
</div>
</body>
```
Kutty will snapshot and restore history to the inner `.content` div.
### Notes
* By and large we recommend not using this attribute