From 23ad209561bc33c1e6d4d50d0f6c90fa1ea7441b Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 17 Jun 2012 16:42:27 +0200 Subject: [PATCH] call Ox.localStorage only once --- source/Ox.UI/js/Core/Theme.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Core/Theme.js b/source/Ox.UI/js/Core/Theme.js index 0c23ecbd..221901c4 100644 --- a/source/Ox.UI/js/Core/Theme.js +++ b/source/Ox.UI/js/Core/Theme.js @@ -9,9 +9,10 @@ Ox.Theme get/set theme Ox.Theme = (function() { - var that = function(theme) { - return theme ? setTheme(theme) : getTheme(); - }; + var localStorage = Ox.localStorage('Ox'), + that = function(theme) { + return theme ? setTheme(theme) : getTheme(); + }; function getTheme() { var classNames = Ox.UI.$body.attr('class'), @@ -123,7 +124,7 @@ Ox.Theme = (function() { }); }); } - Ox.localStorage('Ox')('theme', theme); + localStorage({theme: theme}); return that; }