Analog clock addition

(cherry picked from commit 7bae93fdb2744b0deab84882506a333ff809b3a3)
This commit is contained in:
Ashley M. Kirchner 2016-07-08 18:57:23 -06:00
parent 8f02cb83ed
commit a9540ffabe
2 changed files with 12 additions and 1 deletions

View File

@ -87,6 +87,13 @@ The following properties can be configured:
<br><b>Default value:</b> <code>false</code>
</td>
</tr>
<tr>
<td><code>secondsColor</code></td>
<td>**Specific to the analog clock** Specifies what color to make the 'seconds' hand.<br>
<br><b>Possible values:</b> <code>any HTML RGB Color</code>
<br><b>Default value:</b> <code>#888888</code>
</td>
</tr>
<tr>
<td><code>analogPlacement</code></td>
<td>**Specific to the analog clock** *(requires displayType set to <code>'both'</code>)* Specifies where the analog clock is in relation to the digital clock<br>

View File

@ -18,6 +18,7 @@ Module.register("clock",{
analogSize: '200px',
analogFace: false,
analogPlacement: 'bottom',
secondsColor: '#888888',
},
// Define required scripts.
getScripts: function() {
@ -141,11 +142,14 @@ Module.register("clock",{
clockSecond.id = "clockSecond";
clockSecond.style.transform = "rotate(" + second + "deg)";
clockSecond.className = "clockSecond";
clockSecond.style.backgroundColor = this.config.secondsColor;
// Combine analog wrappers
clockFace.appendChild(clockHour);
clockFace.appendChild(clockMinute);
clockFace.appendChild(clockSecond);
if (this.config.displaySeconds) {
clockFace.appendChild(clockSecond);
}
clockCircle.appendChild(clockFace);
}