mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46: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
|
// 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 () {
|
||||||
if (app.user.timeagoCode && app.user.timeagoCode !== 'en') {
|
$(document).ready(async function () {
|
||||||
await import(/* webpackChunkName: "timeago/[request]" */ 'timeago/locales/jquery.timeago.' + app.user.timeagoCode);
|
if (app.user.timeagoCode && app.user.timeagoCode !== 'en') {
|
||||||
}
|
await import(/* webpackChunkName: "timeago/[request]" */ 'timeago/locales/jquery.timeago.' + app.user.timeagoCode);
|
||||||
ajaxify.parseData();
|
}
|
||||||
app.load();
|
ajaxify.parseData();
|
||||||
});
|
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();
|
||||||
|
|||||||
Reference in New Issue
Block a user