@pageboard/html 0.10.28 → 0.10.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/ui/consent.js +8 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.10.28",
3
+ "version": "0.10.29",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
package/ui/consent.js CHANGED
@@ -46,13 +46,16 @@ class HTMLCustomConsentElement extends HTMLFormElement {
46
46
  if (e.type == "submit") e.preventDefault();
47
47
  if (this.isContentEditable) return;
48
48
  const consents = window.HTMLCustomFormElement.prototype.read.call(this);
49
- const list = Array.from(this.constructor.explicits);
49
+ const names = new Set();
50
+ for (const node of this.elements) {
51
+ if (node.name?.startsWith('consent.')) names.push(node.name);
52
+ }
50
53
  const def = consents.consent;
51
- for (const consent of list) {
52
- if (def != "custom") consents[consent] = def;
54
+ if (def != "custom") for (const consent of names) {
55
+ consents[consent] = def;
53
56
  }
54
- if (list.some(c => consents[c] == null)) {
55
- // not all explicit consents have been answered
57
+ if (Array.from(names).some(c => consents[c] == null)) {
58
+ // not all consents have been answered
56
59
  return;
57
60
  }
58
61
  for (const [key, val] of Object.entries(consents)) {