mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Finishing touches on finder
This commit is contained in:
@@ -3310,7 +3310,9 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const finderContainer = document.getElementById("finder-container");
|
||||||
const finderInput = document.getElementById("finder-input");
|
const finderInput = document.getElementById("finder-input");
|
||||||
|
const finder = document.getElementById("finder");
|
||||||
let lastInput;
|
let lastInput;
|
||||||
|
|
||||||
finderInput.addEventListener("keyup", updateSearchListings);
|
finderInput.addEventListener("keyup", updateSearchListings);
|
||||||
@@ -3345,19 +3347,33 @@ $(document).ready(function(){
|
|||||||
finder_selection_index = future;
|
finder_selection_index = future;
|
||||||
updateFinderSelection(delta);
|
updateFinderSelection(delta);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
finderContainer.addEventListener("click", function(e) {
|
||||||
|
finderContainer.classList.add("hidden");
|
||||||
|
});
|
||||||
|
|
||||||
|
finder.addEventListener("click", function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener("keydown", function(event) {
|
document.addEventListener("keydown", function(event) {
|
||||||
|
const finderContainer = document.getElementById("finder-container");
|
||||||
|
if (event.key === "Escape") finderContainer.classList.add("hidden");
|
||||||
|
|
||||||
if (!event.ctrlKey) return;
|
if (!event.ctrlKey) return;
|
||||||
|
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
// TODO: Add other shortcuts
|
// TODO: Add other shortcuts
|
||||||
case "k":
|
case "k":
|
||||||
const finderContainer = document.getElementById("finder-container");
|
|
||||||
const finderInput = document.getElementById("finder-input");
|
const finderInput = document.getElementById("finder-input");
|
||||||
|
finderInput.value = "";
|
||||||
|
$(".finder-result").remove();
|
||||||
|
finder_selection_index = -1;
|
||||||
|
|
||||||
finderContainer.classList.remove("hidden");
|
finderContainer.classList.remove("hidden");
|
||||||
finderInput.focus();
|
finderInput.focus();
|
||||||
finder_selection_index = -1;
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user