fix: use consistent partial attribute naming (#1847)
This commit is contained in:
+3
-2
@@ -1,6 +1,7 @@
|
||||
export const PARTIAL_SEARCH_PARAM = "fresh-partial";
|
||||
export const PARTIAL_ATTR = "fh-partial";
|
||||
export const LOADING_ATTR = "fh-loading";
|
||||
export const PARTIAL_ATTR = "f-partial";
|
||||
export const LOADING_ATTR = "f-loading";
|
||||
export const CLIENT_NAV_ATTR = "f-client-nav";
|
||||
export const DATA_KEY_ATTR = "data-fresh-key";
|
||||
|
||||
export const enum PartialMode {
|
||||
|
||||
@@ -13,6 +13,7 @@ import { assetHashingHook } from "../utils.ts";
|
||||
import { type SerializedState } from "../../server/rendering/fresh_tags.tsx";
|
||||
import type { Signal } from "@preact/signals";
|
||||
import {
|
||||
CLIENT_NAV_ATTR,
|
||||
DATA_KEY_ATTR,
|
||||
LOADING_ATTR,
|
||||
PARTIAL_ATTR,
|
||||
@@ -748,11 +749,11 @@ document.addEventListener("click", async (e) => {
|
||||
// There are two cases to account for:
|
||||
// 1. Partial request
|
||||
// 2. Normal request (turbolink-style)
|
||||
const settingEl = el.closest("[fresh-client-nav]");
|
||||
const settingEl = el.closest(`[${CLIENT_NAV_ATTR}]`);
|
||||
if (
|
||||
partial === null && (
|
||||
settingEl === null ||
|
||||
settingEl.getAttribute("fresh-client-nav") !== "true"
|
||||
settingEl.getAttribute(CLIENT_NAV_ATTR) !== "true"
|
||||
)
|
||||
) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user