ctrl + s now submits the config editor form.

This commit is contained in:
Ross Mountjoy 2020-05-30 10:05:40 -04:00
parent 38f7c18e2f
commit 634d21ac2d

View File

@ -22,4 +22,25 @@ sleep(500).then(() => {
}
});
});
var ctrlDown = false;
var saved = false;
$( document ).keydown(function( e ) {
if (e.key === 'Control') {
ctrlDown = true;
}
if (e.key === 's' && ctrlDown && !saved) {
e.preventDefault(); // prevent save-as-webpage popup
saved = true;
$("#save-config-btn").trigger("click")
}
});
$( document ).keyup(function( e ) {
if (e.key === 'Control') {
ctrlDown = false;
}
if (e.key === 's' && saved) {
saved = false;
}
});
});