mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-15 17:25:26 -04:00
Research panel: Past Research library hint goes inline with section title
Was rendering on a second row below the "Past research" header, inflating it to two rows. Now appended to the title span as a small inline chip — "Past research — all in Library, Research" — keeping the header at one row. Same click → close panel + open Library tab.
This commit is contained in:
+19
-15
@@ -805,22 +805,26 @@ function _renderJobs() {
|
|||||||
});
|
});
|
||||||
const body = document.createElement('div');
|
const body = document.createElement('div');
|
||||||
body.className = 'research-section-body';
|
body.className = 'research-section-body';
|
||||||
// Hint inside the "Past research" header (second line, styled like the main
|
// Past Research header: link goes INLINE next to the title instead
|
||||||
// Research description) — past research is kept in the Library's Research tab.
|
// of on a second row. Append it to the title span as a small chip.
|
||||||
if (key === 'past') {
|
if (key === 'past') {
|
||||||
const hint = document.createElement('div');
|
const titleEl = header.querySelector('.research-section-title');
|
||||||
hint.className = 'memory-desc doclib-desc research-library-hint';
|
if (titleEl) {
|
||||||
hint.innerHTML = 'All past research found in <button type="button" class="research-library-link">Library, Research</button>';
|
const hint = document.createElement('span');
|
||||||
hint.querySelector('.research-library-link').addEventListener('click', (e) => {
|
hint.className = 'research-library-hint research-library-hint-inline';
|
||||||
e.stopPropagation();
|
hint.style.cssText = 'margin-left:8px;font-size:10.5px;opacity:0.65;font-weight:normal;';
|
||||||
// Close the research panel first so the Library opens ABOVE it on mobile
|
hint.innerHTML = '— all in <button type="button" class="research-library-link" style="background:none;border:none;padding:0;font:inherit;color:var(--accent, var(--red));cursor:pointer;text-decoration:underline;">Library, Research</button>';
|
||||||
// (otherwise it stacks under the full-screen panel).
|
hint.querySelector('.research-library-link').addEventListener('click', (e) => {
|
||||||
closePanel();
|
e.stopPropagation();
|
||||||
if (window.documentModule && window.documentModule.openLibrary) {
|
// Close the research panel first so the Library opens ABOVE it on mobile
|
||||||
window.documentModule.openLibrary({ tab: 'research' });
|
// (otherwise it stacks under the full-screen panel).
|
||||||
}
|
closePanel();
|
||||||
});
|
if (window.documentModule && window.documentModule.openLibrary) {
|
||||||
header.appendChild(hint);
|
window.documentModule.openLibrary({ tab: 'research' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
titleEl.appendChild(hint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
arr.forEach(j => body.appendChild(_buildJobCard(j)));
|
arr.forEach(j => body.appendChild(_buildJobCard(j)));
|
||||||
sec.appendChild(header);
|
sec.appendChild(header);
|
||||||
|
|||||||
Reference in New Issue
Block a user