@majeanson/lac 3.4.4 → 3.4.5
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.
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -21386,7 +21386,7 @@ document.querySelectorAll('.feature-page').forEach(p => p.classList.add('hidden'
|
|
|
21386
21386
|
var hash = window.location.hash.slice(1);
|
|
21387
21387
|
if (hash) { showPage(hash); }
|
|
21388
21388
|
})();
|
|
21389
|
-
// Click delegation — catch clicks on any element with data-id (nav items, TOC cards)
|
|
21389
|
+
// Click delegation — catch clicks on any element with data-id (nav items, TOC cards, search results)
|
|
21390
21390
|
document.addEventListener('click', function(e) {
|
|
21391
21391
|
var el = e.target.closest('[data-id]');
|
|
21392
21392
|
if (!el) return;
|
|
@@ -21395,6 +21395,8 @@ document.addEventListener('click', function(e) {
|
|
|
21395
21395
|
e.preventDefault();
|
|
21396
21396
|
showPage(id);
|
|
21397
21397
|
history.pushState(null, '', '#' + id);
|
|
21398
|
+
gsearch.value = '';
|
|
21399
|
+
sresults.classList.remove('visible');
|
|
21398
21400
|
});
|
|
21399
21401
|
// Browser back/forward navigation
|
|
21400
21402
|
window.addEventListener('popstate', function() {
|
|
@@ -21427,8 +21429,7 @@ gsearch.addEventListener('input', () => {
|
|
|
21427
21429
|
} else {
|
|
21428
21430
|
sresults.innerHTML = matches.map(f => {
|
|
21429
21431
|
const snip = strip(f.guide).slice(0, 90) + (f.guide.length > 90 ? '\u2026' : '');
|
|
21430
|
-
|
|
21431
|
-
return '<div class="sr-item" onclick="showPage(' + id + ');gsearch.value=\'\';sresults.classList.remove(\'visible\')">'
|
|
21432
|
+
return '<div class="sr-item" data-id="' + f.id + '">'
|
|
21432
21433
|
+ '<div class="sr-title">' + hlText(f.title, q) + '</div>'
|
|
21433
21434
|
+ '<div class="sr-domain">' + hlText(f.domain.replace(/-/g,' '), q) + ' \u00b7 ' + f.status + '</div>'
|
|
21434
21435
|
+ '<div class="sr-snippet">' + hlText(snip, q) + '</div>'
|