run_query : replace JQuery.hotkeys by standard keys detection (#359)

Use same technique as the one in #345
This commit is contained in:
Pierre Goiffon
2023-03-14 17:54:09 +01:00
committed by GitHub
parent 5d20b76476
commit c3816c9d0b
3 changed files with 18 additions and 10 deletions

View File

@@ -177,13 +177,14 @@ try
$oQueryTextArea->AddCSSClasses(['ibo-input-text', 'ibo-query-oql', 'ibo-is-code']);
$oQueryForm->AddSubBlock($oQueryTextArea);
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot()."/js/jquery.hotkeys.js");
$oP->add_ready_script(<<<EOF
$oP->add_ready_script(<<<JS
$("#expression").select();
$("#expression").on("keydown", null, "ctrl+return", function() {
$(this).closest("form").submit();
$("#expression").on('keyup', function (oEvent) {
if ((oEvent.ctrlKey || oEvent.metaKey) && oEvent.key === 'Enter') {
$(this).closest('form').trigger('submit');
}
});
EOF
JS
);
if (count($aArgs) > 0) {