0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-12-22 21:23:48 +01:00

additions to Thermometer to allow the general Update function to show() and hide() the Thermometer's container DIV

This commit is contained in:
Adriaan Wormgoor 2013-09-18 10:57:46 +02:00
parent 77b6ed3357
commit 82165c585b
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,5 @@
var $displayThermometer;
function Thermometer() {
this.currentTemperature = 0; // default val
this.targetTemperature = 180; // default val
@ -20,9 +22,11 @@ function Thermometer() {
[244, 50, 50] // 'ready / hot'
];
this.init = function(targCanvas) {
this.init = function(targCanvas, targCanvasContainer) {
console.log("Thermometer.init()");
$displayThermometer = targCanvasContainer;
this.$canvas = targCanvas;
this.canvas = this.$canvas[0];
this.context = this.canvas.getContext('2d');

View File

@ -37,7 +37,7 @@ $(function() {
initPreviewRendering();
initButtonBehavior();
thermometer.init($("#thermometerCanvas"));
thermometer.init($("#thermometerCanvas"), $("#thermometerContainer"));
printer.init();
$(document).on(Printer.UPDATE,update);