Skip to content

Commit

Permalink
Suggestions in alphabetical order
Browse files Browse the repository at this point in the history
  • Loading branch information
Stintipacchio committed Feb 20, 2024
1 parent 5dbeca3 commit fa93600
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 98 deletions.
15 changes: 2 additions & 13 deletions Interface/static/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ $(document).ready(function() {
if (input.length >= 1) {
$(".scrollable-suggestions").css("border", "1px solid #ced4da");
var suggestions = trie.getWordsWithPrefix(input.toLowerCase());
suggestions.sort(); // Sort the suggestions alphabetically
$.each(suggestions, function(index, value) {
suggestionsContainer.append('<div class="suggestion">' + value + '</div>');
});
Expand All @@ -93,6 +94,7 @@ $(document).ready(function() {
$(".scrollable-suggestions").css("border", "none");
}
}


// Function to handle input for drug search
$('#drugSearch').on('input', function() {
Expand All @@ -119,19 +121,6 @@ $(document).ready(function() {
$('#conditionSuggestions').html('');
});

// Mouse wheel scrolling for drug suggestions
$('#drugSuggestions').on('wheel', function(e) {
var delta = e.originalEvent.deltaY;
this.scrollTop += (delta > 0 ? 1 : -1) * 20;
e.preventDefault();
});

// Mouse wheel scrolling for condition suggestions
$('#conditionSuggestions').on('wheel', function(e) {
var delta = e.originalEvent.deltaY;
this.scrollTop += (delta > 0 ? 1 : -1) * 20;
e.preventDefault();
});
});


Expand Down
85 changes: 0 additions & 85 deletions Interface/static/oldcode.txt

This file was deleted.

4 changes: 4 additions & 0 deletions Interface/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
background-color: #2064d4;
color: white;
}

a {
color: #2064d4;
}

#results {
height:30vh;
Expand Down

0 comments on commit fa93600

Please sign in to comment.