From 5b1571ad1ecf5bd4f2e4020fe917b04070ba9d5b Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 17 Aug 2015 16:11:26 -0400 Subject: [PATCH] don't need to refresh to preview updated skin #3069 --- public/src/client/account/settings.js | 7 +++++++ src/controllers/api.js | 1 + 2 files changed, 8 insertions(+) diff --git a/public/src/client/account/settings.js b/public/src/client/account/settings.js index 434072a0b0..23afc2f5c0 100644 --- a/public/src/client/account/settings.js +++ b/public/src/client/account/settings.js @@ -61,6 +61,13 @@ define('forum/account/settings', ['forum/account/header'], function(header) { return false; }); + + $('#bootswatchSkin').on('change', function() { + var css = $('#bootswatchCSS'), + val = $(this).val() === 'default' ? config['theme:src'] : 'http://maxcdn.bootstrapcdn.com/bootswatch/latest/' + $(this).val() + '/bootstrap.min.css'; + + css.attr('href', val); + }); }; return AccountSettings; diff --git a/src/controllers/api.js b/src/controllers/api.js index c09a96490d..cc51bfce52 100644 --- a/src/controllers/api.js +++ b/src/controllers/api.js @@ -63,6 +63,7 @@ apiController.getConfig = function(req, res, next) { config.postsPerPage = meta.config.postsPerPage || 20; config.maximumFileSize = meta.config.maximumFileSize; config['theme:id'] = meta.config['theme:id']; + config['theme:src'] = meta.config['theme:src']; config.defaultLang = meta.config.defaultLang || 'en_GB'; config.userLang = req.query.lang || config.defaultLang; config.environment = process.env.NODE_ENV;