Compare commits
2 Commits
fd65c1b43a
...
32080e5aef
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32080e5aef | ||
|
|
dbc5e64505 |
@ -122,12 +122,21 @@ class OverviewManager {
|
|||||||
if (!pane) return;
|
if (!pane) return;
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case 'overview': pane.innerHTML = this.renderOverview(); break;
|
case 'overview': pane.innerHTML = this.renderOverview(); break;
|
||||||
case 'updates': pane.innerHTML = this.renderUpdates(); break;
|
case 'updates': pane.innerHTML = this.renderUpdates(); this._honorAppDeepLink(); break;
|
||||||
case 'improvements': pane.innerHTML = this.renderImprovements(); break;
|
case 'improvements': pane.innerHTML = this.renderImprovements(); break;
|
||||||
case 'backups': pane.innerHTML = this.renderBackups(); break;
|
case 'backups': pane.innerHTML = this.renderBackups(); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Open the row named by ?app=<name> on load / repaint — makes an expanded row
|
||||||
|
// a shareable URL, mirroring the Tasks page's ?task=<id> deep-link.
|
||||||
|
_honorAppDeepLink() {
|
||||||
|
const app = new URLSearchParams(window.location.search).get('app');
|
||||||
|
if (!app) return;
|
||||||
|
const details = document.getElementById(`ov-detail-${app}`);
|
||||||
|
if (details && details.hidden) this.toggleAppDetails(app);
|
||||||
|
}
|
||||||
|
|
||||||
// ---- clicks --------------------------------------------------------------
|
// ---- clicks --------------------------------------------------------------
|
||||||
|
|
||||||
_handleClick(e) {
|
_handleClick(e) {
|
||||||
@ -268,10 +277,12 @@ class OverviewManager {
|
|||||||
const head = root && root.querySelector(`.ov-row[data-app="${(window.CSS && CSS.escape) ? CSS.escape(app) : app}"] .ov-row-head`);
|
const head = root && root.querySelector(`.ov-row[data-app="${(window.CSS && CSS.escape) ? CSS.escape(app) : app}"] .ov-row-head`);
|
||||||
if (!details) return;
|
if (!details) return;
|
||||||
const isOpen = !details.hidden;
|
const isOpen = !details.hidden;
|
||||||
|
const base = `/overview/${this.current || 'updates'}`;
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
details.hidden = true;
|
details.hidden = true;
|
||||||
details.classList.remove('ov-open');
|
details.classList.remove('ov-open');
|
||||||
if (head) { head.setAttribute('aria-expanded', 'false'); head.classList.remove('ov-open'); }
|
if (head) { head.setAttribute('aria-expanded', 'false'); head.classList.remove('ov-open'); }
|
||||||
|
window.history.replaceState({ route: base }, '', base);
|
||||||
} else {
|
} else {
|
||||||
if (!details.dataset.filled && this.updater) {
|
if (!details.dataset.filled && this.updater) {
|
||||||
const appObj = (this.updater.apps || []).find((x) => x.name === app);
|
const appObj = (this.updater.apps || []).find((x) => x.name === app);
|
||||||
@ -281,6 +292,7 @@ class OverviewManager {
|
|||||||
details.hidden = false;
|
details.hidden = false;
|
||||||
details.classList.add('ov-open');
|
details.classList.add('ov-open');
|
||||||
if (head) { head.setAttribute('aria-expanded', 'true'); head.classList.add('ov-open'); }
|
if (head) { head.setAttribute('aria-expanded', 'true'); head.classList.add('ov-open'); }
|
||||||
|
window.history.replaceState({ route: `${base}?app=${encodeURIComponent(app)}` }, '', `${base}?app=${encodeURIComponent(app)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user