mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 23:35:13 +00:00
Support #anchor redirect refresh (#1172)
This commit is contained in:
parent
3845e0f92e
commit
7296c0d943
@ -3307,17 +3307,18 @@ return (function () {
|
||||
return;
|
||||
}
|
||||
|
||||
var shouldRefresh = hasHeader(xhr, /HX-Refresh:/i) && "true" === xhr.getResponseHeader("HX-Refresh");
|
||||
|
||||
if (hasHeader(xhr, /HX-Redirect:/i)) {
|
||||
location.href = xhr.getResponseHeader("HX-Redirect");
|
||||
shouldRefresh && location.reload();
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasHeader(xhr,/HX-Refresh:/i)) {
|
||||
if ("true" === xhr.getResponseHeader("HX-Refresh")) {
|
||||
if (shouldRefresh) {
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasHeader(xhr,/HX-Retarget:/i)) {
|
||||
responseInfo.target = getDocument().querySelector(xhr.getResponseHeader("HX-Retarget"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user