Skip to content

Commit

Permalink
feat: change LLM modal controls to toggle open/close for easier review (
Browse files Browse the repository at this point in the history
#393)

Ctrl Shift ? now toggles the LLM model open and closed, making it easier
to quickly check the chart behind the modal.

Fixes #379
  • Loading branch information
ellvix authored Feb 6, 2024
1 parent 1648e27 commit 63e52b4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ class Menu {
]);
constants.events.push([
document.getElementById('menu'),
'keydown',
'keyup',
function (e) {
if (e.key == 'Esc') {
// esc
Expand Down Expand Up @@ -813,7 +813,7 @@ class ChatLLM {
}
constants.events.push([
document.getElementById('chatLLM'),
'keydown',
'keyup',
function (e) {
if (e.key == 'Esc') {
// esc
Expand All @@ -822,13 +822,13 @@ class ChatLLM {
},
]);

// ChatLLM open events
// ChatLLM open/close toggle
constants.events.push([
document,
'keyup',
function (e) {
if (e.key == '?' && (e.ctrlKey || e.metaKey)) {
chatLLM.Toggle(true);
chatLLM.Toggle();
}
},
]);
Expand All @@ -845,7 +845,7 @@ class ChatLLM {
]);
constants.events.push([
document.getElementById('chatLLM_input'),
'keydown',
'keyup',
function (e) {
if (e.key == 'Enter' && !e.shiftKey) {
let text = document.getElementById('chatLLM_input').value;
Expand Down Expand Up @@ -1198,7 +1198,7 @@ class ChatLLM {
* Toggles the modal on and off.
* @param {boolean} [onoff=false] - Whether to turn the chatLLM on or off. Defaults to false (close).
*/
Toggle(onoff = false) {
Toggle(onoff) {
if (typeof onoff == 'undefined') {
if (document.getElementById('chatLLM').classList.contains('hidden')) {
onoff = true;
Expand Down Expand Up @@ -1376,7 +1376,7 @@ class Description {
}
constants.events.push([
document.getElementById('description'),
'keydown',
'keyup',
function (e) {
if (e.key == 'Esc') {
// esc
Expand Down

0 comments on commit 63e52b4

Please sign in to comment.