diff --git a/index.js b/index.js index 053605f0..dc6f4717 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,8 @@ Ox.load(function() { user: { item: {doc: '', examples: '', readme: ''}, page: '', - previousPage: 'about' + previousPage: 'about', + theme: 'classic' } }, db: Ox.localStorage('OxJS'), @@ -139,15 +140,15 @@ Ox.load(function() { }, html: {}, init: function() { + app.user = Ox.extend(app.data.user, app.db()); app.loadScreen(function() { app.loadData(function() { - Ox.load({UI: {theme: app.theme}}, app.load); + Ox.load('UI', {theme: app.user.theme}, app.load); }); }); }, load: function(browserSupported) { var url = app.url.get(); - app.user = Ox.extend(app.data.user, app.db()) app.user.page = url.page; if (url.item && url.page in app.user.item) { app.user.item[url.page] = url.item; @@ -241,7 +242,7 @@ Ox.load(function() { }); }, loadScreen: function(callback) { - app.setTheme(app.user.theme || 'classic'); + app.setTheme(app.user.theme); app.$ui.screen = app.ui.screen(); app.$ui.loading = app.ui.loading(); app.$ui.logo = app.ui.logo() @@ -255,9 +256,7 @@ Ox.load(function() { callback(); } }); - Ox.$(window).on({ - resize: app.resize - }); + Ox.$(window).on({resize: app.resize}); }, patchButtonGroup: function($buttonGroup) { $buttonGroup.find('.OxButton').css({