diff --git a/uhr.js b/uhr.js
index 1e0bb84..75849af 100644
--- a/uhr.js
+++ b/uhr.js
@@ -30,12 +30,14 @@ along with this program. If not, see .
language: 'de_CH',
theme: 'black',
force: false,
- controls: true
+ controls: true,
+ time: new Date()
},
start: function() {
if (!this._isOn()) {
var uhr = this;
this._timer = window.setInterval(function() {
+ uhr.options.time = new Date();
uhr._update();
}, 1000);
this._update();
@@ -80,21 +82,16 @@ along with this program. If not, see .
}
},
time: function(time) {
- this.options.time = time;
if (time == null) {
this._currentMinute = -1;
- this._update();
+ this.options.time = new Date();
} else {
if (this._timer != null) {
window.clearInterval(this._timer);
}
- var renderer = new UhrRenderer(this._language(), this.element.find('.letterarea'));
- var uhr = this;
- renderer.render(this, function() {
- uhr._show(time);
- });
-
+ this.options.time = time;
}
+ this._update();
},
// private variables
_id: -1,
@@ -106,7 +103,7 @@ along with this program. If not, see .
},
_update: function() {
if (this._isOn()) {
- var time = new Date();
+ var time = this.options.time;
if (time.getMinutes() == this._currentMinute) {
return;
}
@@ -355,7 +352,7 @@ UhrRenderer.prototype.render = function(uhr, beforeshow) {
break;
default:
if (console !== undefined && typeof console.log == 'function') {
- console.log("Unknown layout version: " + this.layout.version);
+ console.error("Unknown layout version: " + this.layout.version);
}
return;
}
@@ -399,7 +396,6 @@ function Letter(value, style) {
} else {
this.style += ' ' + style;
}
- console.log(this.getStyle());
}
}
Letter.prototype.toString = function letterToString() {