mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-27 13:01:03 +00:00
1.3.1 release
This commit is contained in:
parent
81a90de0c5
commit
3c8f6417b1
@ -1,6 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
## [1.3.1] - 2021-3-9
|
||||
|
||||
* IE11 fixes
|
||||
|
||||
## [1.3.0] - 2021-3-6
|
||||
|
||||
* Support a `target` modifier on `hx-trigger` to filter based on the element targeted by an event. This allows
|
||||
|
@ -35,7 +35,7 @@ By removing these arbitrary constraints htmx completes HTML as a
|
||||
|
||||
```html
|
||||
<!-- Load from unpkg -->
|
||||
<script src="https://unpkg.com/htmx.org@1.3.0" ></script>
|
||||
<script src="https://unpkg.com/htmx.org@1.3.1" ></script>
|
||||
<!-- have a button POST a click via AJAX -->
|
||||
<button hx-post="/clicked" hx-swap="outerHTML">
|
||||
Click Me
|
||||
|
32
dist/htmx.js
vendored
32
dist/htmx.js
vendored
@ -177,6 +177,12 @@ return (function () {
|
||||
}
|
||||
}
|
||||
|
||||
function maybeCall(func){
|
||||
if(func) {
|
||||
func();
|
||||
}
|
||||
}
|
||||
|
||||
function isType(o, type) {
|
||||
return Object.prototype.toString.call(o) === "[object " + type + "]";
|
||||
}
|
||||
@ -981,7 +987,7 @@ return (function () {
|
||||
evt.stopPropagation();
|
||||
}
|
||||
if (triggerSpec.target && evt.target) {
|
||||
if (!evt.target.matches(triggerSpec.target)) {
|
||||
if (!matches(evt.target, triggerSpec.target)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1965,10 +1971,12 @@ return (function () {
|
||||
var resolve = null;
|
||||
var reject = null;
|
||||
etc = etc != null ? etc : {};
|
||||
var promise = new Promise(function (_resolve, _reject) {
|
||||
resolve = _resolve;
|
||||
reject = _reject;
|
||||
});
|
||||
if(typeof Promise !== "undefined"){
|
||||
var promise = new Promise(function (_resolve, _reject) {
|
||||
resolve = _resolve;
|
||||
reject = _reject;
|
||||
});
|
||||
}
|
||||
if(elt == null) {
|
||||
elt = getDocument().body;
|
||||
}
|
||||
@ -2005,7 +2013,7 @@ return (function () {
|
||||
// prompt returns null if cancelled and empty string if accepted with no entry
|
||||
if (promptResponse === null ||
|
||||
!triggerEvent(elt, 'htmx:prompt', {prompt: promptResponse, target:target}))
|
||||
resolve();
|
||||
maybeCall(resolve);
|
||||
endRequestLock();
|
||||
return promise;
|
||||
}
|
||||
@ -2013,7 +2021,7 @@ return (function () {
|
||||
var confirmQuestion = getClosestAttributeValue(elt, "hx-confirm");
|
||||
if (confirmQuestion) {
|
||||
if(!confirm(confirmQuestion)) {
|
||||
resolve();
|
||||
maybeCall(resolve);
|
||||
endRequestLock()
|
||||
return promise;
|
||||
}
|
||||
@ -2065,7 +2073,7 @@ return (function () {
|
||||
|
||||
if(errors && errors.length > 0){
|
||||
triggerEvent(elt, 'htmx:validation:halted', requestConfig)
|
||||
resolve();
|
||||
maybeCall(resolve);
|
||||
endRequestLock();
|
||||
return promise;
|
||||
}
|
||||
@ -2120,7 +2128,7 @@ return (function () {
|
||||
}
|
||||
triggerEvent(finalElt, 'htmx:afterRequest', responseInfo);
|
||||
triggerEvent(finalElt, 'htmx:afterOnLoad', responseInfo);
|
||||
resolve();
|
||||
maybeCall(resolve);
|
||||
endRequestLock();
|
||||
}
|
||||
}
|
||||
@ -2132,7 +2140,7 @@ return (function () {
|
||||
}
|
||||
triggerErrorEvent(finalElt, 'htmx:afterRequest', responseInfo);
|
||||
triggerErrorEvent(finalElt, 'htmx:sendError', responseInfo);
|
||||
reject();
|
||||
maybeCall(reject);
|
||||
endRequestLock();
|
||||
}
|
||||
xhr.onabort = function() {
|
||||
@ -2143,11 +2151,11 @@ return (function () {
|
||||
}
|
||||
triggerErrorEvent(finalElt, 'htmx:afterRequest', responseInfo);
|
||||
triggerErrorEvent(finalElt, 'htmx:sendAbort', responseInfo);
|
||||
reject();
|
||||
maybeCall(reject);
|
||||
endRequestLock();
|
||||
}
|
||||
if(!triggerEvent(elt, 'htmx:beforeRequest', responseInfo)){
|
||||
resolve();
|
||||
maybeCall(resolve);
|
||||
endRequestLock()
|
||||
return promise
|
||||
}
|
||||
|
2
dist/htmx.min.js
vendored
2
dist/htmx.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/htmx.min.js.gz
vendored
BIN
dist/htmx.min.js.gz
vendored
Binary file not shown.
@ -97,13 +97,13 @@ It can be used via [NPM](https://www.npmjs.com/) as "`htmx.org`" or downloaded o
|
||||
[unpkg](https://unpkg.com/browse/htmx.org/) or your other favorite NPM-based CDN:
|
||||
|
||||
``` html
|
||||
<script src="https://unpkg.com/htmx.org@1.3.0"></script>
|
||||
<script src="https://unpkg.com/htmx.org@1.3.1"></script>
|
||||
```
|
||||
|
||||
For added security, you can load the script using [Subresource Integrity (SRI)](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity).
|
||||
|
||||
``` html
|
||||
<script src="https://unpkg.com/htmx.org@1.3.0" integrity="sha384-SRglfaqPHLuqU8LUUSQoeTFBY7CNqaVDs3vy/TONuLgrQu/UVJ/BvC0DPn4ZGcJ4" crossorigin="anonymous"></script>
|
||||
<script src="https://unpkg.com/htmx.org@1.3.1" integrity="sha384-fIzHaKYVrEFxI4/dWpMzf9tlIUPU0HmW8w/8s4nQHvZmGQhXhnEM6aenC6QFkd7e" crossorigin="anonymous"></script>
|
||||
```
|
||||
|
||||
## <a name="ajax"></a> [AJAX](#ajax)
|
||||
|
@ -35,7 +35,7 @@ By removing these arbitrary constraints htmx completes HTML as a
|
||||
|
||||
```html
|
||||
<!-- Load from unpkg -->
|
||||
<script src="https://unpkg.com/htmx.org@1.3.0"></script>
|
||||
<script src="https://unpkg.com/htmx.org@1.3.1"></script>
|
||||
<!-- have a button POST a click via AJAX -->
|
||||
<button hx-post="/clicked" hx-swap="outerHTML">
|
||||
Click Me
|
||||
|
Loading…
x
Reference in New Issue
Block a user