Skip to content

Commit

Permalink
Focus on code mirror in gquery sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
noracato committed Jul 1, 2024
1 parent 5be0fab commit 44a4944
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ $(document).on("turbo:load", function () {
viewportMargin: Infinity,
});

if ($(this).attr("name") == "query") {
cm.focus();
}

// Ctrl+Enter submit on any CodeMirror instance
cm.on("keydown", function (el, event) {
if (event.ctrlKey && event.keyCode === 13) {
Expand Down

0 comments on commit 44a4944

Please sign in to comment.