|
@@ -336,7 +336,9 @@
|
|
.html('<span class="d-block no-suggest-items">Searching...</span>')
|
|
.html('<span class="d-block no-suggest-items">Searching...</span>')
|
|
.removeClass('d-none');
|
|
.removeClass('d-none');
|
|
$.get('/patients-suggest?term=' + term, function(_data) {
|
|
$.get('/patients-suggest?term=' + term, function(_data) {
|
|
- $('.patient-search-results.suggestions-outer').html(_data).removeClass('d-none');
|
|
|
|
|
|
+ if($.trim($('#patient-search').val()) === term) { // use returned data only if it's for the sent "term"
|
|
|
|
+ $('.patient-search-results.suggestions-outer').html(_data).removeClass('d-none');
|
|
|
|
+ }
|
|
});
|
|
});
|
|
lastTerm = term;
|
|
lastTerm = term;
|
|
}
|
|
}
|
|
@@ -389,7 +391,7 @@
|
|
window.setTimeout(onQueryChange, 50);
|
|
window.setTimeout(onQueryChange, 50);
|
|
})
|
|
})
|
|
.on('blur', function(e) {
|
|
.on('blur', function(e) {
|
|
- $('.patient-search-results.suggestions-outer').addClass('d-none');
|
|
|
|
|
|
+ // $('.patient-search-results.suggestions-outer').addClass('d-none');
|
|
return false;
|
|
return false;
|
|
});
|
|
});
|
|
|
|
|