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 // eslint-disable-next-line import/no-unresolved
require('../../scripts-admin'); require('../../scripts-admin');
app.onDomReady();
(function () { (function () {
let logoutTimer = 0; let logoutTimer = 0;
let logoutMessage; let logoutMessage;

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

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

Loading…
Cancel
Save