Skip to content
Snippets Groups Projects
Commit 7fa09c5b authored by Mike Lynch's avatar Mike Lynch
Browse files

Text search is now using SearchPath.uri and coming up as a filter

parent e0a87cdc
Branches
No related merge requests found
const delegate = require('./Delegate');
const SearchPath = require('./SearchPath');
const RegisterEvents = function (state) {
delegate('#app', 'click', '#search-text', async () => {
const search = document.querySelector('#text-to-search');
window.location.hash = `#search/${state.main.start}/${state.main.page}/${search.value}`;
window.location.hash = SearchPath.toURI(state.main.currentSearch, { 'main_search': search.value }).substr(1);
});
delegate('#app', 'keyup', '#text-to-search', async (event) => {
if (event.keyCode === 13) {
event.preventDefault();
const search = document.querySelector('#text-to-search');
window.location.hash = `#search/${state.main.start}/${state.main.page}/${search.value}`;
window.location.hash = SearchPath.toURI(state.main.currentSearch, { 'main_search': search.value }).substr(1);
}
});
delegate('#app', 'click', '#search-text-1', async () => {
const search = document.querySelector('#text-to-search');
window.location.hash = `#search/${state.main.start}/${state.main.page}/${search.value}`;
});
};
module.exports = RegisterEvents;
\ No newline at end of file
......@@ -16,7 +16,7 @@ const ListDocs = function (data) {
</li>`;
});
} else {
html += `<div class="text-center"> No data found</div>`;
html += `<div class="text-center">No search results</div>`;
}
html += `</ul><div><br/></div>`;
html += `</div></div>`;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment