mirror of
https://github.com/remoteintech/remote-jobs
synced 2025-01-27 19:45:09 +00:00
Add a link to search for incomplete profiles
This commit is contained in:
parent
de7db578ba
commit
f6384c90cb
1 changed files with 14 additions and 2 deletions
|
@ -17,9 +17,19 @@ function setupSearch() {
|
||||||
searchExplanation.id = 'search-explanation';
|
searchExplanation.id = 'search-explanation';
|
||||||
searchExplanation.innerHTML = (
|
searchExplanation.innerHTML = (
|
||||||
'Use the text box above to search all of our company data.'
|
'Use the text box above to search all of our company data.'
|
||||||
|
+ ' You can also '
|
||||||
|
+ '<a href="#" id="search-incomplete">search for incomplete company profiles</a>.'
|
||||||
);
|
);
|
||||||
table.parentNode.insertBefore( searchExplanation, table );
|
table.parentNode.insertBefore( searchExplanation, table );
|
||||||
|
|
||||||
|
document.getElementById( 'search-incomplete' )
|
||||||
|
.addEventListener( 'click', function( event ) {
|
||||||
|
event.preventDefault();
|
||||||
|
searchInput.value = '_incomplete';
|
||||||
|
initializeSearch();
|
||||||
|
updateSearch();
|
||||||
|
} );
|
||||||
|
|
||||||
var searchLoading = false;
|
var searchLoading = false;
|
||||||
var searchData = null;
|
var searchData = null;
|
||||||
var searchIndex = null;
|
var searchIndex = null;
|
||||||
|
@ -155,7 +165,7 @@ function setupSearch() {
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
searchInput.addEventListener( 'focus', function() {
|
function initializeSearch() {
|
||||||
if ( searchData || searchLoading ) {
|
if ( searchData || searchLoading ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -189,7 +199,9 @@ function setupSearch() {
|
||||||
};
|
};
|
||||||
|
|
||||||
xhr.send();
|
xhr.send();
|
||||||
} );
|
}
|
||||||
|
|
||||||
|
searchInput.addEventListener( 'focus', initializeSearch );
|
||||||
|
|
||||||
searchInput.addEventListener( 'keyup', function() {
|
searchInput.addEventListener( 'keyup', function() {
|
||||||
if ( updateTimeout ) {
|
if ( updateTimeout ) {
|
||||||
|
|
Loading…
Reference in a new issue