Lisää hakukenttä admin-julkaisulistaan
This commit is contained in:
11
admin.html
11
admin.html
@@ -367,6 +367,9 @@
|
|||||||
<!-- POST LIST -->
|
<!-- POST LIST -->
|
||||||
<section class="admin-panel">
|
<section class="admin-panel">
|
||||||
<h2 id="lbl_all_posts">Kaikki julkaisut</h2>
|
<h2 id="lbl_all_posts">Kaikki julkaisut</h2>
|
||||||
|
<input type="text" id="postSearch" placeholder="Hae julkaisuja..." oninput="filterPostList()"
|
||||||
|
style="width:100%;padding:9px 13px;border:2px solid #e8d5c0;border-radius:8px;font-size:0.95rem;
|
||||||
|
font-family:Georgia,serif;color:#3b2a1a;outline:none;margin-bottom:12px;box-sizing:border-box;" />
|
||||||
<div class="post-list" id="postList"></div>
|
<div class="post-list" id="postList"></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -713,6 +716,14 @@
|
|||||||
`).join('');
|
`).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function filterPostList() {
|
||||||
|
const q = document.getElementById('postSearch').value.toLowerCase();
|
||||||
|
document.querySelectorAll('#postList .post-item').forEach(el => {
|
||||||
|
const text = el.querySelector('h3').textContent.toLowerCase();
|
||||||
|
el.style.display = text.includes(q) ? '' : 'none';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================
|
// ===========================
|
||||||
// TOAST
|
// TOAST
|
||||||
// ===========================
|
// ===========================
|
||||||
|
|||||||
Reference in New Issue
Block a user