closed #159 - issue where theme listing would hang if a theme folder did

not contain theme.json

Also refactored theme socket event a bit
This commit is contained in:
Julian Lam
2013-08-11 13:09:27 -04:00
parent 27f874759e
commit 272806a25d
3 changed files with 5 additions and 9 deletions

View File

@@ -39,7 +39,7 @@ var nodebb_admin = (function(nodebb_admin) {
(function() {
var scriptEl = document.createElement('script');
scriptEl.src = 'http://api.bootswatch.com?callback=nodebb_admin.themes.render';
scriptEl.src = 'http://api.bootswatch.com/2/?callback=nodebb_admin.themes.render';
document.body.appendChild(scriptEl);
var bootstrapThemeContainer = document.querySelector('#bootstrap_themes'),
@@ -81,7 +81,7 @@ var nodebb_admin = (function(nodebb_admin) {
}, false);
// Installed Themes
socket.once('api:admin:themes.getInstalled', function(themes) {
socket.emit('api:admin.themes.getInstalled', function(themes) {
var instListEl = document.getElementById('installed_themes'),
themeFrag = document.createDocumentFragment(),
liEl = document.createElement('li');
@@ -108,5 +108,4 @@ var nodebb_admin = (function(nodebb_admin) {
instListEl.innerHTML = '';
instListEl.appendChild(themeFrag);
});
socket.emit('api:admin:themes.getInstalled');
})();