Fix prefs, autoload.

This commit is contained in:
Will Scullin 2019-11-23 15:19:29 -08:00
parent 996d13b3cd
commit 0366fc712b
No known key found for this signature in database
GPG Key ID: 9092A5C0A673416B

View File

@ -389,8 +389,10 @@ document.addEventListener('DOMContentLoaded', function() {
el.checked = JSON.parse(val);
});
document.querySelectorAll('input[type=checkbox]').forEach(function(el) {
el.addEventListener('change', function() {
prefs.writePref(el.id, JSON.stringify(el.checked));
});
});
}
turbotape = document.querySelector('#turbo_tape').checked;
@ -438,12 +440,11 @@ document.addEventListener('DOMContentLoaded', function() {
}
}
document.querySelector('#text_input').value = script;
document.querySelector('#tape').css('width', 100);
} else {
aci.setData(tape.tracks);
document.querySelector('#text_input').value = tape.script;
doLoadText();
}
doLoadText();
}
document.querySelector('#tape_select').addEventListener('change', doTapeSelect);