Compare commits

..

3 Commits

Author SHA1 Message Date
be440684b3 Merge commit '80d30a8e5425f4041e79c299095c36386b8d7777' into dev
All checks were successful
continuous-integration/drone/push Build is passing
close #26
2021-01-07 20:24:44 +01:00
80d30a8e54 ▶ ENTER key submit
ref #26
2021-01-07 20:23:45 +01:00
0c3e74f8a3 escape key support
ref #26
2021-01-07 20:21:17 +01:00

View File

@ -19,6 +19,20 @@
$: 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;
}
if (e.keyCode === 13) {
if (createbtnenabled === true) {
createbtnenabled = false;
submit();
}
}
};
})();
function submit() {
if (processed_last_submit === true) {
processed_last_submit = false;