From e398011737ed5c45ead0e50a3489da15e9ac8b89 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Mon, 25 Nov 2013 13:42:03 +0100 Subject: [PATCH] layoutswitch robustisiert --- index.html | 4 +--- uhr.js | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 22bd6aa..05d035f 100644 --- a/index.html +++ b/index.html @@ -47,9 +47,7 @@ $('#layoutswitcher').on('change', function() { switchLayout(this.value); }); - currentLayout = layout['de_CH']; - renderLayout(); - startClock(); + switchLayout('de_CH'); }); diff --git a/uhr.js b/uhr.js index 783aae3..676dc35 100644 --- a/uhr.js +++ b/uhr.js @@ -97,6 +97,9 @@ function switchTheme(theme) { function switchLayout(locale) { stopClock(); currentLayout = layout[locale]; + if (currentLayout == undefined) { + currentLayout = layout['default']; + } renderLayout(); if (isOn()) { startClock();