Skip to content

Commit

Permalink
Change commands input behaviour with single result
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloredis committed Dec 3, 2024
1 parent f260c40 commit b1932e2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions static/js/commands-filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ const FILTERS = {
}
};

nameFilter = FILTERS.name.element
nameFilter.addEventListener('keydown', function(event) {
switch (event.key) {
case "Enter":
visible_commands = document.querySelectorAll("article.flex.flex-col.gap-2.transition.relative:not([style='display: none;'])")
if (visible_commands.length == 1) {
event.preventDefault();
command_href = visible_commands[0].getElementsByTagName("a")[0].href
window.location.assign(command_href)
};
default:
return;
}
});

const hiddenCards = [];

function setDisabledVersions(value) {
Expand Down

0 comments on commit b1932e2

Please sign in to comment.