runAfterButtons

This commit is contained in:
Laetitia (O-01-67) 2022-12-29 10:13:41 -05:00 committed by GitHub
parent dff965bb99
commit 190afe14e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -2,8 +2,14 @@ function runAfterAutogen(func) {
runAfterAutogenList.push(func); runAfterAutogenList.push(func);
}; };
function runAfterButtons(func) {
runAfterButtonsList.push(func);
};
runAfterAutogenList = []; runAfterAutogenList = [];
runAfterButtonsList = [];
function behaviorStringsToArrays() { function behaviorStringsToArrays() {
for (var behavior in behaviors) { for (var behavior in behaviors) {
if (typeof behaviors[behavior][0] === "string") { if (typeof behaviors[behavior][0] === "string") {
@ -821,6 +827,10 @@ window.onload = function() {
// Alphabetically sort and loop through dictionary named "elements" // Alphabetically sort and loop through dictionary named "elements"
createButtonsAndCountElements(); createButtonsAndCountElements();
for (var i = 0; i < runAfterButtonsList.length; i++) {
runAfterButtonsList[i]();
};
selectElement(currentElement); selectElement(currentElement);
focusGame(); focusGame();
// For every button element, onkeyup="event.preventDefault()" // For every button element, onkeyup="event.preventDefault()"