default-verhalten geflickt

This commit is contained in:
Manuel Friedli 2013-11-28 13:36:56 +01:00
parent a9ee9ec62c
commit 9391ab119a

6
uhr.js
View file

@ -201,7 +201,7 @@ Uhr.prototype.initToggleSwitch = function(defaultValue, overrideCookie) {
uhr.toggle();
});
var status = $.cookie('status' + this.id);
if (overrideCookie && (defaultValue != undefined)) {
if (status == undefined || (overrideCookie && (defaultValue != undefined))) {
status = defaultValue;
}
if (status == undefined || status == 'undefined') {
@ -221,7 +221,7 @@ Uhr.prototype.initLayoutSwitch = function(defaultValue, overrideCookie) {
uhr.setLayout(this.value);
});
var selectedLayout = $.cookie('layout' + this.id);
if (overrideCookie && (defaultValue != undefined)) {
if (selectedLayout == undefined || (overrideCookie && (defaultValue != undefined))) {
selectedLayout = defaultValue;
}
if (selectedLayout == undefined || selectedLayout == 'undefined') {
@ -236,7 +236,7 @@ Uhr.prototype.initThemeSwitch = function(defaultValue, overrideCookie) {
uhr.setTheme(this.value);
});
var selectedTheme = $.cookie('theme' + this.id);
if (overrideCookie && (defaultValue != undefined)) {
if (selectedTheme == undefined || (overrideCookie && (defaultValue != undefined))) {
selectedTheme = defaultValue;
}
if (selectedTheme == undefined || selectedTheme == 'undefined') {