Compare commits
2 Commits
a1f70ff654
...
5d82597d14
Author | SHA1 | Date |
---|---|---|
jordi fita mas | 5d82597d14 | |
jordi fita mas | b0db8df732 |
|
@ -401,6 +401,7 @@ class Tags extends HTMLDivElement {
|
||||||
customElements.define('numerus-multiselect', Multiselect, {extends: 'div'});
|
customElements.define('numerus-multiselect', Multiselect, {extends: 'div'});
|
||||||
customElements.define('numerus-tags', Tags, {extends: 'div'});
|
customElements.define('numerus-tags', Tags, {extends: 'div'});
|
||||||
|
|
||||||
|
let savedTitle = '';
|
||||||
|
|
||||||
htmx.onLoad((target) => {
|
htmx.onLoad((target) => {
|
||||||
if (target.tagName === 'DIALOG') {
|
if (target.tagName === 'DIALOG') {
|
||||||
|
@ -408,6 +409,8 @@ htmx.onLoad((target) => {
|
||||||
for (const detail of details) {
|
for (const detail of details) {
|
||||||
detail.removeAttribute('open');
|
detail.removeAttribute('open');
|
||||||
}
|
}
|
||||||
|
savedTitle = document.title;
|
||||||
|
document.title = target.querySelector('h2').textContent + ' — ' + savedTitle.substring(savedTitle.indexOf("—") + 1);
|
||||||
target.showModal();
|
target.showModal();
|
||||||
const button = target.querySelector('.close-dialog');
|
const button = target.querySelector('.close-dialog');
|
||||||
if (button) {
|
if (button) {
|
||||||
|
@ -425,6 +428,7 @@ htmx.on('closeModal', () => {
|
||||||
}
|
}
|
||||||
openDialog.close();
|
openDialog.close();
|
||||||
openDialog.remove();
|
openDialog.remove();
|
||||||
|
document.title = savedTitle;
|
||||||
});
|
});
|
||||||
|
|
||||||
htmx.on(document, 'alpine:init', () => {
|
htmx.on(document, 'alpine:init', () => {
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
<title>{{ template "title" . }} — Numerus</title>
|
||||||
{{- template "breadcrumbs" . }}
|
{{- template "breadcrumbs" . }}
|
||||||
{{- template "content" . }}
|
{{- template "content" . }}
|
||||||
|
|
Loading…
Reference in New Issue