Skip to content

Commit

Permalink
delay some functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vankasteelj committed Nov 24, 2024
1 parent 06d6b66 commit 4075ec7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
8 changes: 3 additions & 5 deletions app/js/utils/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ const Boot = {
scheduler.postTask(Boot.idle, {priority: 'background'}) // periodically update

// right clicks
scheduler.postTask(() => {
document.addEventListener('contextmenu', (e) => e.preventDefault())
Interface.rightClickNav()
Boot.setupRightClicks('input[type=text], textarea')
}, {priority: 'background'})
document.addEventListener('contextmenu', (e) => e.preventDefault())
scheduler.postTask(Interface.rightClickNav, {priority: 'background'})
scheduler.postTask(() => Boot.setupRightClicks('input[type=text], textarea'), {priority: 'background'})
},

// STARTUP: setup network connexion
Expand Down
23 changes: 13 additions & 10 deletions app/js/utils/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,20 @@ const Localization = {
t[i].innerText = i18n.__(t[i].innerText)
}
}
for (let j = 0; j < c.length; j++) {
if (c[j].title) {
c[j].title = i18n.__(c[j].title)
}
if (c[j].placeholder) {
c[j].placeholder = i18n.__(c[j].placeholder)
}
if (c[j].innerText && c[j].localName === 'option') {
c[j].innerText = i18n.__(c[j].innerText)

scheduler.postTask(() => {
for (let j = 0; j < c.length; j++) {
if (c[j].title) {
c[j].title = i18n.__(c[j].title)
}
if (c[j].placeholder) {
c[j].placeholder = i18n.__(c[j].placeholder)
}
if (c[j].innerText && c[j].localName === 'option') {
c[j].innerText = i18n.__(c[j].innerText)
}
}
}
}, {priority: 'background'})
},

// STARTUP: build dropdown menu for changing app localization
Expand Down

0 comments on commit 4075ec7

Please sign in to comment.