mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-03 07:45:21 +00:00
changelog prep
This commit is contained in:
parent
29829fd776
commit
725bd72be2
13
CHANGELOG.md
13
CHANGELOG.md
@ -1,7 +1,18 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
## [1.0.0] - 2020-12-?
|
## [1.0.1] - 2020-12-?
|
||||||
|
|
||||||
|
* AJAX file upload now correctly fires events, allowing for [a proper progress bar](https://htmx.org/examples/file-upload)
|
||||||
|
* htmx api functions that expect an element now can accept a string selector instead:
|
||||||
|
```js
|
||||||
|
htmx.on('#form', 'htmx:xhr:progress', function(evt) {
|
||||||
|
htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)
|
||||||
|
});
|
||||||
|
```
|
||||||
|
* htmx now properly handles the `multiple` attribute on `<select>` elements
|
||||||
|
|
||||||
|
## [1.0.0] - 2020-11-24
|
||||||
|
|
||||||
* Bumped the release version :)
|
* Bumped the release version :)
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ First the pure javascript version.
|
|||||||
* We listen for the `htmx:xhr:progress` event and update the `value` attribute of the progress bar based on the `loaded` and `total` properties in the even detail.
|
* We listen for the `htmx:xhr:progress` event and update the `value` attribute of the progress bar based on the `loaded` and `total` properties in the even detail.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<form hx-encoding='multipart/form-data' hx-post='/upload'>
|
<form id='form1' hx-encoding='multipart/form-data' hx-post='/upload'>
|
||||||
<input type='file' name='file'>
|
<input type='file' name='file'>
|
||||||
<button>
|
<button>
|
||||||
Upload
|
Upload
|
||||||
@ -25,7 +25,7 @@ First the pure javascript version.
|
|||||||
<progress id='progress' value='0' max='100'></progress>
|
<progress id='progress' value='0' max='100'></progress>
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
htmx.on('htmx:xhr:progress', function(evt) {
|
htmx.on('#form', 'htmx:xhr:progress', function(evt) {
|
||||||
htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)
|
htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user