Merge pull request #288 from EdouardVanbelle/fix/frontend-search-view
This commit is contained in:
+1
-1
@@ -214,7 +214,7 @@
|
|||||||
<div class="content-area">
|
<div class="content-area">
|
||||||
<h1 class="page-title" data-i18n="nav.files">Files</h1>
|
<h1 class="page-title" data-i18n="nav.files">Files</h1>
|
||||||
|
|
||||||
<div class="page-sticky-header">
|
<div class="page-sticky-header" id="page-sticky-header">
|
||||||
<div class="actions-bar" id="actions-bar">
|
<div class="actions-bar" id="actions-bar">
|
||||||
|
|
||||||
<div class="action-buttons" id="action-buttons">
|
<div class="action-buttons" id="action-buttons">
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ const search = {
|
|||||||
*/
|
*/
|
||||||
displaySearchResults(results) {
|
displaySearchResults(results) {
|
||||||
window.ui.resetFilesList(); // ensure also list visible & error hidden
|
window.ui.resetFilesList(); // ensure also list visible & error hidden
|
||||||
const filesList = document.getElementById('files-list');
|
//FIXME: move into action rather bage sticky header + hide bread crumb ? + note also that search result does not consider section
|
||||||
|
const pageStickyHeader = document.getElementById('page-sticky-header');
|
||||||
|
|
||||||
// Search results header with query time and sort controls
|
// Search results header with query time and sort controls
|
||||||
const totalCount = results.total_count || results.files.length + results.folders.length;
|
const totalCount = results.total_count || results.files.length + results.folders.length;
|
||||||
@@ -135,7 +136,13 @@ const search = {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
filesList.appendChild(searchHeader);
|
const previousSearchHeader = document.querySelector('.search-results-header');
|
||||||
|
|
||||||
|
if (previousSearchHeader) {
|
||||||
|
previousSearchHeader.replaceWith(searchHeader);
|
||||||
|
} else {
|
||||||
|
pageStickyHeader.appendChild(searchHeader);
|
||||||
|
}
|
||||||
|
|
||||||
// Sort dropdown — re-searches with new sort order (server-side)
|
// Sort dropdown — re-searches with new sort order (server-side)
|
||||||
const sortSelect = document.getElementById('search-sort-select');
|
const sortSelect = document.getElementById('search-sort-select');
|
||||||
@@ -158,6 +165,7 @@ const search = {
|
|||||||
document.querySelector('.search-container input').value = '';
|
document.querySelector('.search-container input').value = '';
|
||||||
window.app.currentPath = '';
|
window.app.currentPath = '';
|
||||||
window.app.isSearchMode = false;
|
window.app.isSearchMode = false;
|
||||||
|
document.querySelector('.search-results-header')?.remove();
|
||||||
window.ui.updateBreadcrumb('');
|
window.ui.updateBreadcrumb('');
|
||||||
window.loadFiles();
|
window.loadFiles();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user