From 0bc4799c3c0de4c49837cda149eebac959c4909a Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 20 Jul 2015 17:16:30 -0400 Subject: [PATCH] remove setTimeout hax in settingsv1 :squirrel: --- public/src/admin/admin.js | 2 +- public/src/admin/settings.js | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/public/src/admin/admin.js b/public/src/admin/admin.js index a0573057e0..bc6d81d747 100644 --- a/public/src/admin/admin.js +++ b/public/src/admin/admin.js @@ -20,7 +20,6 @@ selectMenuItem(data.url); setupHeaderMenu(); setupRestartLinks(); - setupCheckboxes(); }); $(window).on('action:admin.settingsLoaded', setupCheckboxes); @@ -43,6 +42,7 @@ // move this to admin.config app.config = config; + $(window).trigger('action:config.loaded'); }); function setupMenu() { diff --git a/public/src/admin/settings.js b/public/src/admin/settings.js index 9fc436a2e7..1eee16a353 100644 --- a/public/src/admin/settings.js +++ b/public/src/admin/settings.js @@ -5,18 +5,10 @@ define('admin/settings', ['uploader', 'sounds'], function(uploader, sounds) { var Settings = {}; Settings.init = function() { - Settings.prepare(); + $(window).on('action:config.loaded', Settings.prepare); }; 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 var fields = $('#content [data-field]'), numFields = fields.length,