call Ox.localStorage only once

This commit is contained in:
rolux 2012-06-17 16:42:27 +02:00
parent 175c8b23d0
commit 23ad209561

View file

@ -9,9 +9,10 @@ Ox.Theme <f> 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;
}