fix: #10642, fix order of dom ready events

plugin $().ready hooks will fire first, core will fire last
isekai-main
Barış Soner Uşaklı 3 years ago
parent abd8e216b0
commit 2bfccac72a

@ -7,6 +7,8 @@ require('../app');
// eslint-disable-next-line import/no-unresolved
require('../../scripts-admin');
app.onDomReady();
(function () {
let logoutTimer = 0;
let logoutMessage;

@ -24,13 +24,16 @@ app.currentRoom = null;
app.widgets = {};
app.flags = {};
document.addEventListener('DOMContentLoaded', async function () {
if (app.user.timeagoCode && app.user.timeagoCode !== 'en') {
await import(/* webpackChunkName: "timeago/[request]" */ 'timeago/locales/jquery.timeago.' + app.user.timeagoCode);
}
ajaxify.parseData();
app.load();
});
app.onDomReady = function () {
$(document).ready(async function () {
if (app.user.timeagoCode && app.user.timeagoCode !== 'en') {
await import(/* webpackChunkName: "timeago/[request]" */ 'timeago/locales/jquery.timeago.' + app.user.timeagoCode);
}
ajaxify.parseData();
app.load();
});
};
(function () {
let appLoaded = false;

@ -6,3 +6,5 @@ require('./app');
// from plugins that add files to "scripts" block in plugin.json
// eslint-disable-next-line import/no-unresolved
require('../scripts-client');
app.onDomReady();

Loading…
Cancel
Save