escape key support

ref #26
This commit is contained in:
Philipp Dormann 2021-01-07 20:21:17 +01:00
parent ac952b6906
commit 0c3e74f8a3

View File

@ -19,6 +19,14 @@
$: isTracklengthValid = tracklength <= 0;
$: trackMintimevalid = track_min_duration >= 0;
$: createbtnenabled = !isTracknameValid && !isTracklengthValid;
(function () {
document.onkeydown = function (e) {
e = e || window.event;
if (e.key === "Escape") {
modal_open = false;
}
};
})();
function submit() {
if (processed_last_submit === true) {
processed_last_submit = false;