mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: #10642, fix order of dom ready events
plugin $().ready hooks will fire first, core will fire last
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user