mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 17:15:31 +00:00
Fixed an error with a nil pointer deref
This commit is contained in:
@@ -4,7 +4,7 @@ tmp_dir = "tmp"
|
|||||||
|
|
||||||
[build]
|
[build]
|
||||||
args_bin = []
|
args_bin = []
|
||||||
full_bin = "npm --prefix views/ run build -- --config vite.dev.config.js; export KGPZ_WATCH=false; ./tmp/main"
|
full_bin = "export KGPZ_WATCH=false; ./tmp/main"
|
||||||
cmd = "go build -tags=\"dev\" -o ./tmp/main ."
|
cmd = "go build -tags=\"dev\" -o ./tmp/main ."
|
||||||
delay = 400
|
delay = 400
|
||||||
exclude_dir = [
|
exclude_dir = [
|
||||||
@@ -29,7 +29,7 @@ kill_delay = "0s"
|
|||||||
log = "build-errors.log"
|
log = "build-errors.log"
|
||||||
poll = false
|
poll = false
|
||||||
poll_interval = 0
|
poll_interval = 0
|
||||||
post_cmd = []
|
post_cmd = ["npm --prefix views/ run build -- --config vite.dev.config.js"]
|
||||||
pre_cmd = []
|
pre_cmd = []
|
||||||
rerun = false
|
rerun = false
|
||||||
rerun_delay = 500
|
rerun_delay = 500
|
||||||
|
|||||||
1
reset.sh
1
reset.sh
@@ -1,3 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
rm -rf ./bin
|
||||||
rm -rf ./cache_gnd
|
rm -rf ./cache_gnd
|
||||||
rm -rf ./data_git
|
rm -rf ./data_git
|
||||||
|
|||||||
@@ -1,22 +1,31 @@
|
|||||||
function a() {
|
function setup() {
|
||||||
document.querySelectorAll("template[simple]").forEach((l) => {
|
let templates = document.querySelectorAll("template[simple]");
|
||||||
let s = l.getAttribute("id"), n = l.content;
|
templates.forEach((template) => {
|
||||||
customElements.define(s, class extends HTMLElement {
|
let templateId = template.getAttribute("id");
|
||||||
|
let templateContent = template.content;
|
||||||
|
customElements.define(templateId, class extends HTMLElement {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(), this.appendChild(n.cloneNode(!0)), this.slots = this.querySelectorAll("slot");
|
super();
|
||||||
|
this.appendChild(templateContent.cloneNode(true));
|
||||||
|
this.slots = this.querySelectorAll("slot");
|
||||||
}
|
}
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
let o = [];
|
let toremove = [];
|
||||||
this.slots.forEach((e) => {
|
this.slots.forEach((tslot) => {
|
||||||
let r = e.getAttribute("name"), t = this.querySelector(`[slot="${r}"]`);
|
let slotName = tslot.getAttribute("name");
|
||||||
t && (e.replaceWith(t.cloneNode(!0)), o.push(t));
|
let slotContent = this.querySelector(`[slot="${slotName}"]`);
|
||||||
}), o.forEach((e) => {
|
if (slotContent) {
|
||||||
e.remove();
|
tslot.replaceWith(slotContent.cloneNode(true));
|
||||||
|
toremove.push(slotContent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
toremove.forEach((element) => {
|
||||||
|
element.remove();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
export {
|
export {
|
||||||
a as setup
|
setup
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user