mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
remove setTimeout hax in settingsv1 :squirrel:
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
selectMenuItem(data.url);
|
selectMenuItem(data.url);
|
||||||
setupHeaderMenu();
|
setupHeaderMenu();
|
||||||
setupRestartLinks();
|
setupRestartLinks();
|
||||||
setupCheckboxes();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).on('action:admin.settingsLoaded', setupCheckboxes);
|
$(window).on('action:admin.settingsLoaded', setupCheckboxes);
|
||||||
@@ -43,6 +42,7 @@
|
|||||||
|
|
||||||
// move this to admin.config
|
// move this to admin.config
|
||||||
app.config = config;
|
app.config = config;
|
||||||
|
$(window).trigger('action:config.loaded');
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupMenu() {
|
function setupMenu() {
|
||||||
|
|||||||
@@ -5,18 +5,10 @@ define('admin/settings', ['uploader', 'sounds'], function(uploader, sounds) {
|
|||||||
var Settings = {};
|
var Settings = {};
|
||||||
|
|
||||||
Settings.init = function() {
|
Settings.init = function() {
|
||||||
Settings.prepare();
|
$(window).on('action:config.loaded', Settings.prepare);
|
||||||
};
|
};
|
||||||
|
|
||||||
Settings.prepare = function(callback) {
|
Settings.prepare = function(callback) {
|
||||||
// Come back in 125ms if the config isn't ready yet
|
|
||||||
if (!app.config) {
|
|
||||||
setTimeout(function() {
|
|
||||||
Settings.prepare(callback);
|
|
||||||
}, 125);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Populate the fields on the page from the config
|
// Populate the fields on the page from the config
|
||||||
var fields = $('#content [data-field]'),
|
var fields = $('#content [data-field]'),
|
||||||
numFields = fields.length,
|
numFields = fields.length,
|
||||||
|
|||||||
Reference in New Issue
Block a user